Script Problem(SetPlayerPos & GetPlayerPOs)
#1

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?
Reply
#2

Код:
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.");
Reply
#3

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
Reply
#4

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

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?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)