16.01.2010, 22:00
Quote:
Originally Posted by GTAguillaume
Quote:
Код:
new admincars[4],bool:lockveh; //lets make 4 admin cars ;) Код:
admincars[0] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[1] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[2] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[3] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay Код:
if (!strcmp("/lockadminvehicles", cmd, true)) { if(lockveh == true) return SendClientMessage(playerid,0xff0000AA,"The cars are already locked!"); for(new i;i<MAX_PLAYERS;i++) { if(IsPlayerConnected(i)) { for(new j;j<sizeof(admincars);j++) SetVehicleParamsForPlayer(admincars[j],playerid,0,1); } } lockveh = true; return 1; } Код:
if (!strcmp("/unlockadminvehicles", cmd, true)) { if(lockveh == false) return SendClientMessage(playerid,0xff0000AA,"The cars are not locked!"); for(new i;i<MAX_PLAYERS;i++) { if(IsPlayerConnected(i)) { for(new j;j<sizeof(admincars);j++) SetVehicleParamsForPlayer(admincars[j],playerid,0,0); } } lockveh = false; return 1; } Код:
if(lockveh)for(new i;i<sizeof(admincars);i++)if(admincars[i] == vehicleid && !IsPlayerAdmin(playerid)) SetVehicleParamsForPlayer(vehicleid,playerid,0,1); EDIT2: Done EDIT3: bugs fixed |
Thanks!