SA-MP Forums Archive
Script Problem(SetPlayerPos & GetPlayerPOs) - 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: Script Problem(SetPlayerPos & GetPlayerPOs) (/showthread.php?tid=497544)



Script Problem(SetPlayerPos & GetPlayerPOs) - Extraordinariness - 27.02.2014

So basically I created a command on which you could teleport to my lobby. my problem is, i couldn't teleport that person who used that command to his own original position.

I tried GetPlayerPos

This iz on my /lobby which you could teleport to my lobby
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, -1, ""COL_RED"Returning to lobby..."COL_WHITE"(10 seconds)");
SetTimerEx("Lobby", 10000, false, "i", playerid);
Mah /exitlobby
pawn Код:
SetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, -1, "You are now back to battlefield.");
How will I?


Re: Script Problem(SetPlayerPos & GetPlayerPOs) - mahardika - 27.02.2014

Код:
new Float:playerlaspos[MAX_PLAYERS][3];
now on /lobby

Код:
GetPlayerPos(playerid, playerlastpos[playerid][1], playerlastpos[playerid][2], playerlastpos[playerid][3]);
SendClientMessage(playerid, -1, ""COL_RED"Returning to lobby..."COL_WHITE"(10 seconds)");
SetTimerEx("Lobby", 10000, false, "i", playerid);
now /exitlobby

Код:
SetPlayerPos(playerid, playerlastpos[playerid][1], playerlastpos[playerid][2], playerlastpos[playerid][3]);
SendClientMessage(playerid, -1, "You are now back to battlefield.");



Re: Script Problem(SetPlayerPos & GetPlayerPOs) - Extraordinariness - 27.02.2014

Waow thanks! I'll rep you as soon as I can(gave many reps on those who helped me 1 by 1) I have another question.
pawn Код:
format(statstring, sizeof(statstring), "LS-FFA Stats:\nKills: %d | Deaths: %d | Money: $%d | Admin Level: %d | Score: %d | Ping: %d |",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],GetPlayerMoney(playerid),PlayerInfo[playerid][pAdminLevel],GetPlayerScore(playerid),GetPlayerPing(playerid));
This loops back to return 0;. How do I fix it ?

EDIT: Errors on the script(/lobby thing)
C:\Documents and Settings\eros\Desktop\SAMP Server\gamemodes\TDScript5.pwn(189) : error 017: undefined symbol "playerlastpos"
C:\Documents and Settings\eros\Desktop\SAMP Server\gamemodes\TDScript5.pwn(189) : warning 215: expression has no effect
C:\Documents and Settings\eros\Desktop\SAMP Server\gamemodes\TDScript5.pwn(189) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\eros\Desktop\SAMP Server\gamemodes\TDScript5.pwn(189) : error 029: invalid expression, assumed zero


Re: Script Problem(SetPlayerPos & GetPlayerPOs) - mahardika - 28.02.2014

place
Код:
new Float:playerlaspos[MAX_PLAYERS][3];
on the top of the script ( under all include )


Re: Script Problem(SetPlayerPos & GetPlayerPOs) - mahardika - 28.02.2014

Quote:
Originally Posted by Extraordinariness
Посмотреть сообщение
Waow thanks! I'll rep you as soon as I can(gave many reps on those who helped me 1 by 1) I have another question.
pawn Код:
format(statstring, sizeof(statstring), "LS-FFA Stats:\nKills: %d | Deaths: %d | Money: $%d | Admin Level: %d | Score: %d | Ping: %d |",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],GetPlayerMoney(playerid),PlayerInfo[playerid][pAdminLevel],GetPlayerScore(playerid),GetPlayerPing(playerid));
This loops back to return 0;. How do I fix it ?
can you give me full cmd/func?