26.03.2011, 11:35
pawn Код:
COMMAND:o(playerid, params[])
{
new text[129];
if(!sscanf(params, "s[128]", text))//z is optional string so null string is still valid
{
new name[MAX_PLAYER_NAME];//To save memory, you don't need to use another string.
GetPlayerName(playerid, name, sizeof(name));
format(text, sizeof(text), "[OOC]%s say: %s ", name, text);//There's no %z in format.Only in sscanf.
//Use the same string here is okay
SendClientMessageToAll(0xFFFFFF, string);//Do you need white colour or cyan?The colour is 32-bit here.
return 1;
}
else return SendClientMessage(playerid, 0xFFFFFF, "USAGE: /o [Text]");//Same as above
}