16.12.2012, 11:02
Код:
CMD:hi(playerid,params[]) { new player1,string[128]; if(sscanf(params, "i",player1)) return SendClientMessage(playerid, 0xFF0000FF,"/hi [Player id]"); format(string,sizeof(string),"%s Says Hi To %s", ReturnName(playerid),ReturnName(player1)); SCMTA(COLOR_GREEN,string); return 1; } CMD:wb(playerid,params[]) { new Player1,string[128]; if(sscanf(params,"i",Player1)) return SendClientMessage(playerid, 0xFF0000FF, "/wb [Player id]"); format(string,sizeof(string),"Welcome Back \"%s\" (From: %s)",ReturnName(Player1),ReturnName(playerid)); SCMTA(COLOR_GREEN,string); return 1; }
Код:
stock ReturnName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); return name; }
Do not use GetPlayerName(playerid);
correct is GetPlayerName(playerid,string,sizeof(string)); ///you can define string with whatever you want example under
Код:
new name[MAX_PLAYER_NAME], string[256]; GetPlayerName(playerid,name,sizeof(name)); format(string,sizeof(string),"Hello %s",name); SMT(-1,string);