Quote:
Originally Posted by Don Correlli
pawn Код:
if(strcmp(cmdtext, "/lowrider", true) == 0) { ResetPlayerWeapons(playerid); if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), 2645.40, -2004.71, 13.38); else SetPlayerPos(playerid, 2645.40, -2004.71, 13.38); GivePlayerMoney(playerid, 50000); return 1; }
|
As you can see, if he is any vehicle then player and vehicle will be teleported (SetVehiclePos), if not then only player will be teleported (SetPlayerPos).
If you want to prevent teleporting on foot, change:
pawn Код:
else SetPlayerPos(playerid, 2645.40, -2004.71, 13.38);
to:
pawn Код:
else SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You can't teleport if you're not in vehicle!");
You maybe want to add PLAYER_STATE_DRIVER check so only driver of the vehicle can teleport it.