Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- new cc[MAX_PLAYERS], colorchange[MAX_VEHICLES];
- forward ChangeColorSec(vehicleid);
- public OnFilterScriptInit( )
- {
- print( "\n[FS] **********************************" );
- print( "[FS] * Vehicle Color Changer by Gireada *" );
- print( "[FS] * Loaded ... *" );
- print( "[FS] ************************************\n" );
- }
- public OnFilterScriptExit( )
- {
- print( "\n[FS] **********************************" );
- print( "[FS] * Vehicle Color Changer by Gireada *" );
- print( "[FS] * Unloaded ... *" );
- print( "[FS] ************************************\n" );
- }
- public OnPlayerConnect(playerid)
- {
- cc[playerid] = 0;
- return 1;
- }
- CMD:ccs(playerid, params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(!(IsPlayerInAnyVehicle(playerid))) return SendClientMessage(playerid, -1, "Trebuie sa fii intr-un vehicul pentru a folosi comanda");
- switch(cc[playerid])
- {
- case 0:
- {
- cc[playerid] = 1;
- SendClientMessage(playerid, -1, "Ai activat culoarea la secunda");
- colorchange[vehicleid] = SetTimerEx("ChangeColorSec", 1000, 1, "d", vehicleid);
- }
- case 1:
- {
- cc[playerid] = 0;
- SendClientMessage(playerid, -1, "Ai dezactivat culoarea la secunda");
- KillTimer(colorchange[vehicleid]);
- }
- }
- return 1;
- }
- public ChangeColorSec(vehicleid)
- {
- new culoare1 = random(255);
- new culoare2 = random(255);
- ChangeVehicleColor(vehicleid, culoare1, culoare2);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement