How i can load some1
#1

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?
Reply
#2

You mean basically to 'arrest' someone and place them in the back seat of your car?
Reply
#3

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
Reply
#4

Код:
//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)
	{
	    if(IsPlayerAdmin(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "Usage: /load<id>");
			targetid = strval(tmp);
			if(IsPlayerConnected(targetid))
			{
			    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)
	{
     DestroyVehicle(Car);
     RemovePlayerFromVehicle(targetid);
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)