16.01.2010, 22:33
(You need strtok for it)
On the top of your script:
OnGameModeInit:
OnVehicleStreamIn:
bugs are possible, post or PM me if you found one. 
Usage: /lockadmincar ID (1-4) and /unlockadmincar ID (1-4)
On the top of your script:
Код:
new admincars[4],bool:lockveh[4]; //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("/lockadminvehicle", cmd, true)) { tmp = strtok(cmdtext,idx); new ID = strval(tmp)-1; if(ID < 0 || ID > sizeof(admincars)) return SendClientMessage(playerid,0xff0000AA,"Invalid ID!"); if(lockveh[ID] == true) return SendClientMessage(playerid,0xff0000AA,"The car is already locked!"); for(new i;i<MAX_PLAYERS;i++) { if(IsPlayerConnected(i)) { SetVehicleParamsForPlayer(admincars[ID],i,0,1); } } lockveh[ID] = true; return 1; }
Код:
if (!strcmp("/unlockadminvehicles", cmd, true)) { tmp = strtok(cmdtext,idx); new ID = strval(tmp)-1; if(ID < 0 || ID > sizeof(admincars)) return SendClientMessage(playerid,0xff0000AA,"Invalid ID!"); if(lockveh[ID] == false) return SendClientMessage(playerid,0xff0000AA,"The car is not locked!"); for(new i;i<MAX_PLAYERS;i++) { if(IsPlayerConnected(i)) { SetVehicleParamsForPlayer(admincars[ID],i,0,0); } } lockveh[ID] = false; return 1; }
Код:
for(new i;i<sizeof(admincars);i++)if(admincars[i] == vehicleid && !IsPlayerAdmin(playerid) && lockveh[ID]) SetVehicleParamsForPlayer(vehicleid,playerid,0,1);

Usage: /lockadmincar ID (1-4) and /unlockadmincar ID (1-4)