View Full Version : How i can load some1

30/12/2011, 07:59 PM
How i can make a command for the police like /load ID and load the player in the car?

like /load ID the player id teleported in the back of the police car as passenger and cant move, than make a command /unload and free him?

30/12/2011, 08:01 PM
You mean basically to 'arrest' someone and place them in the back seat of your car?

30/12/2011, 08:03 PM
yes, i mean this i also need a /ar (time) system.. but i dont know how to make :( there are the only thing i need for end my server :(

30/12/2011, 08:26 PM
//by: Swift_

new bool:PlayerInCar[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
new cmd[256], tmp[256], targetid, idx;
new Float:x, Float:y, Float:z, Float:a;
cmd = strtok(cmdtext, idx);

if(strcmp(cmd, "/load", true) == 0)
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "Usage: /load<id>");
targetid = strval(tmp);
SendClientMessage(playerid, GREEN, "Player can't find the keys!");
SendClientMessage(targetid, RED, "You have been locked to police car ");

PlayerInCar[targetid] = true;
GetPlayerPos(targetid, x, y, z);
GetPlayerFacingAngle(targetid, a);
Car = CreateVehicle(597, x, y, z+5, a, 1, 1, 100000);
PutPlayerInVehicle(targetid, Car, 1);
return 1;

else return SendClientMessage(playerid, RED, "Not allowed to use this command!");
return 0;

public OnPlayerExitVehicle(playerid, vehicleid)
new targetid;
if(vehicleid == Car && PlayerInCar[playerid] == true)
return 1;