put player in car problem
#2

Код:
CMD:putplayerincar(playerid, params[])
{
	new id, seat, vehicle = GetPlayerVehicleID(playerid);
	
	if(sscanf(params,"ud",id,seat)) return SCM(playerid, COLOR_GREY, "USAGE: /putplayerincar [player ID] [seats 1-3]");

	if(seat > 3 || seat < 1) return SCM(playerid, COLOR_RED, "ERROR: Pick one 1 or 3.");
	if(id == playerid) return SCM(playerid, COLOR_RED, "ERROR: You can't put yourself in a vehicle.");
	if(!PlayerInCar(playerid)) return SCM(playerid, COLOR_RED, "ERROR: You have to be in a vehicle.");
	
	if(!PlayerNearPlayer(10.0, playerid, id)) return NotNearPlayerMSG(playerid);
	
	ClearAnimations(id, 1);
	PutPlayerInVehicle(id, vehicle, seat);
	
	SCMEx(playerid, COLOR_YELLOW, "-> %s you have put him in a vehicle.", GetNameEx(id));
	SCMEx(id, COLOR_YELLOW, "-> %s put you in a vehicle.", GetNameEx(playerid));
	return 1;
}


stock NotNearPlayerMSG(playerid)
{
	return SCM(playerid, COLOR_RED, "ERROR: You aren't near that player.");
}
Start with this maybe?
Reply


Messages In This Thread
put player in car problem - by PoniStar - 21.02.2019, 09:51
Re: put player in car problem - by RudeWorld - 21.02.2019, 10:05
Re: put player in car problem - by TheToretto - 21.02.2019, 10:21

Forum Jump:


Users browsing this thread: 1 Guest(s)