Goto - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Goto (
/showthread.php?tid=498256)
Goto -
Ananisiki - 02.03.2014
So, i am editing my goto command, right now admins who is in a vehicle can't use it, but i'll make it so they can,
but first, i want to check if the player they want go to is in a interior, if they are, they will get a message there it says "this player is in a interior, you cannot go to him"
pawn Код:
new Float:x, Float:y, Float:z;
if(IsPlayerInAnyVehicle(playerid)) {
GetPlayerPos(pID, x, y, z);
SetPlayerInterior(playerid, GetPlayerInterior(pID));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pID));
SetVehiclePos(GetPlayerVehicleID(playerid), x+2, y+2, z);
}
else
{
GetPlayerPos(pID, x, y, z);
SetPlayerInterior(playerid, GetPlayerInterior(pID));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pID));
SetPlayerPos(playerid, x+2, y+2, z);
}
Re: Goto -
TomatoRage - 02.03.2014
pawn Код:
new Float:x, Float:y, Float:z;
if(IsPlayerInAnyVehicle(playerid)) {
GetPlayerPos(pID, x, y, z);
SetPlayerInterior(playerid, GetPlayerInterior(pID));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pID));
SetVehiclePos(GetPlayerVehicleID(playerid), x+2, y+2, z);
}
else
{
GetPlayerPos(pID, x, y, z);
SetPlayerInterior(playerid, GetPlayerInterior(pID));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pID));
SetPlayerPos(playerid, x+2, y+2, z);
}
if(GetPlayerInterior(pID) > 0)
{
SendCilentMessage(playerid,COLOR,"You cannot go to this player because he is in interior.");
return 1;
}