16.08.2013, 20:56
I'm trying to make an admin chat for a test gamemode I'm making, I just started learning how to code pawno about 10 hours ago and I've had help from a few advanced friends. I'm trying to store the player's name and what they typed both as the variable of %s, using it twice. The player's name is correctly displayed but their message is show as y. Included below is the code.
Код:
CMD:achat(playerid,params[])
{
new admins[MAX_PLAYERS];
#define admin 0
new name[MAX_PLAYER_NAME+1], string[70];
new text[128];
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "uu", text)) return SendClientMessage(playerid,COL_WHITE,"[USAGE]: /achat [message]");
admins[playerid] = admin;
GetPlayerName(playerid,name,sizeof(name));
format(string, sizeof(string), "(( %s: %s ))", name, text);
SendClientMessage(admin,COL_YELLOW,string);
}
else
{
if(sscanf(params, "uu", text)) return SendClientMessage(playerid,COL_WHITE,"[ERROR]: You do not have access to this command!");
}
return 1;
}



