Target ID.
#1

So, let's say I want to set a player's name, how do I target HIS ID to be changed? Like, HIS name and not mine (playerid).
Reply
#2

First, use sscanf and create 2 variables, target and newname.

Second, update his/her account name (if you're using file saving/MySQL)

Lastly, use SetPlayerName to a new name.
Reply
#3

Declare new variable of the target id
pawn Код:
new targetid;
Here's a simple example
pawn Код:
CMD:setname(playerid,params[])
{
    new targetid;
    SetPlayerName(targetid,params);
    return 1;
}
EDIT: Ops sorry i was too late.
Reply
#4

Thanks a lot you both! I never thought targetid actually existed hehe, thanks.
And yeah, I've already done the variable name, I just didnt know targetid existed at all :P.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)