27.09.2009, 11:21
Hey,another noobie question
i've tried to make an afk cmd,and it came totally wrong.
i don't know a lot about strings and all,but,i tried to make SetPlayerName,like i done with SendClientMessageToAll,idk,i probably done something really wrong.look what i've tried:
There are no errors.
what suppose to happen,is that when someone types /afk,his name will become [AFK]Name.or something..
and when i type /AFK it's only sending the message,but nothing happens with the name 0.0
Yes i know,there are a lot of topics like that,but i didnt see any solution in the comments o_O..
And they were old,so i didnt want to post a comment there,i just started a new topic.
And don't laugh at me,im really noobie at scripting.
Help appreciated,Thanks in advance.
i've tried to make an afk cmd,and it came totally wrong.
i don't know a lot about strings and all,but,i tried to make SetPlayerName,like i done with SendClientMessageToAll,idk,i probably done something really wrong.look what i've tried:
pawn Код:
if (strcmp("/afk", cmdtext, true, 10) == 0)
{
new name[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[AFK]%s.", name );
SetPlayerName(playerid,string);
format(string, sizeof(string), "%s is Afk,:(.", name );
SendClientMessageToAll(GREEN,string);
}
what suppose to happen,is that when someone types /afk,his name will become [AFK]Name.or something..
and when i type /AFK it's only sending the message,but nothing happens with the name 0.0
Yes i know,there are a lot of topics like that,but i didnt see any solution in the comments o_O..
And they were old,so i didnt want to post a comment there,i just started a new topic.
And don't laugh at me,im really noobie at scripting.
Help appreciated,Thanks in advance.