11.12.2011, 15:24
Use a stock to get players name:
Then, in a command or something which gets a players name, instead of doing:
You could do:
pawn Код:
stock pName(playerid)
{
new name[24];
GetPlayerName(playerid, name, 24));
return name;
}
pawn Код:
if(!strcmp(cmdtext, "/hello", true, 4))
{
new string[128], name[24];
GetPlayerName(playerid,name,24);
format(string,128,"Hello %s !",name);
SendClientMessage(playerid,-1,string);
}
pawn Код:
if(!strcmp(cmdtext, "/hello", true, 4))
{
new string[128];
format(string,128,"Hello %s !",pName);
SendClientMessage(playerid,-1,string);
}