SA-MP Forums Archive
/asay help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /asay help (/showthread.php?tid=221287)



/asay help - YungGee - 05.02.2011

Help my admin message not working it shows name but not the message/params any help :S >>

Код:
CMD:asay(playerid, params[])
{
	if(pInfo[playerid][Level] < 2) return SendClientMessage(playerid,RED,">> You Must Be Level 2+ To Use This Command!");
    if(!strlen(params)) return SendClientMessage(playerid, RED, "USAGE: /asay [msg]");
	new string[24], pname[24];
    GetPlayerName(playerid, pname, 24);
	format(string, sizeof(string), ">> Admin %s Says: %s", pname, params);
	return SendClientMessageToAll(COLOR_LIGHTGREEN,string);
}



Re: /asay help - HyperZ - 05.02.2011

pawn Код:
CMD:asay( playerid, params[ ] )
{
    new string[128], pname[MAX_PLAYER_NAME];
    if(pInfo[playerid][Level] < 2) return SendClientMessage(playerid,RED,">> You Must Be Level 2+ To Use This Command!");
    if(isnull(params)) return SendClientMessage(playerid, RED, "USAGE: /asay [msg]");
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    format(string, sizeof(string), ">> Admin %s Says: %s", pname, params);
    SendClientMessageToAll(COLOR_LIGHTGREEN,string);
    return 1;
}
Edit: your string arrays was too small, i guess.