Position help - 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: Position help (
/showthread.php?tid=554990)
Position help -
Ananisiki - 06.01.2015
This if i use on player who is in interior, i just spawn in air, it dont set me to the interior, my interior is alwyes id 0
pawn Код:
GetPlayerPos(playerid, GotoX[playerid], GotoY[playerid], GotoZ[playerid]);
GotoInterior[playerid] = GetPlayerInterior(playerid);
GotoVWorld[playerid] = GetPlayerVirtualWorld(playerid);
new Float:x, Float:y, Float:z;
SetPlayerInterior(playerid, GetPlayerInterior(pID));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pID));
GetPlayerPos(pID, x, y, z);
if(IsPlayerInAnyVehicle(pID)) SetPlayerPos(playerid, x, y, z+1.6);
else
{
switch(random(3))
{
case 0: SetPlayerPos(playerid, x + 1.5, y, z);
case 1: SetPlayerPos(playerid, x, y + 1.5, z);
case 2: SetPlayerPos(playerid, x+0.7, y+0.7, z+1);
}
}
Re: Position help -
VishvaJeet - 06.01.2015
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(pID, x, y, z);
new Interior = GetPlayerInterior(pID);
new World = GetPlayerVirtualWorld(pID);
SetPlayerInterior(playerid, Interior);
SetPlayerVirtualWorld(playerid, World);
if(IsPlayerInAnyVehicle(pID)) SetPlayerPos(playerid, x, y, z+1.6);
else
{
switch(random(3))
{
case 0: SetPlayerPos(playerid, x + 1.5, y, z);
case 1: SetPlayerPos(playerid, x, y + 1.5, z);
case 2: SetPlayerPos(playerid, x+0.7, y+0.7, z+1);
}
}
Try this, or show me full command, why you used 2 times GetPlayerPos(...); ?