SA-MP Forums Archive
Fix /go command - 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: Fix /go command (/showthread.php?tid=367637)



Fix /go command - kbalor - 10.08.2012

If I do /go to a player the string send to me not for the player I have teleported.

Fixed...

pawn Код:
else SetPlayerPos(playerid, x + 1, y + 1, z);
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(str, sizeof(str), "{FFFF00}(/go) %s (%d) has teleported to you", name, playerid);
    SendClientMessage(playerid, 0xFFFFFFFF, str);
    return 1
I just follow newbienoob said..


Re: Fix /go command - newbienoob - 10.08.2012

GetPlayerName(ID, name, MAX_PLAYER_NAME);


Re: Fix /go command - leonardo1434 - 10.08.2012

You're sending the message to the playerid, take a look at sendclientmessage.


Re: Fix /go command - newbienoob - 10.08.2012

Didn't realize that...
SendClientMessage(ID, 0xFFFFFFFF, str);


Re: Fix /go command - kbalor - 10.08.2012

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
You're sending the message to the playerid, take a look at sendclientmessage.
Well you mean do I need to change it to SendClientMessage(playerid, 0xFFFFFFFF, str);

to SendClientMessage(ID, 0xFFFFFFFF, str);

And i will just remain GetPlayerName(playerid, name, MAX_PLAYER_NAME);