Code has errors. Any help ? [URGENT] - 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)
+--- Thread: Code has errors. Any help ? [URGENT] (
/showthread.php?tid=593045)
Code has errors. Any help ? [URGENT] -
Commands - 01.11.2015
PHP код:
COMMAND:asay(playerid, params[])
{
new Announce[35];
if(sscanf(params, "s[35]", Announce)) return SendClientMessage(playerid, -1, "ERROR: The correct syntax is /asay [Message]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Only RCON Admins can use the command");
GetPlayerName(playerid, pInfo[playerid][Nick], 20);
format(string, SOS, "Admin %s: %s", pInfo[playerid][Nick], playerid, Announce);
SendClientMessageToAll(0xFFC0CBAA, string);
return 1;
}
Uhm..the code shows no errors while compiling but some weird effects IG. How to fix ?
Re: Code has errors. Any help ? [URGENT] -
ATGOggy - 01.11.2015
pawn Код:
COMMAND:asay(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, -1, "ERROR: The correct syntax is /asay [Message]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Only RCON Admins can use the command");
GetPlayerName(playerid, pInfo[playerid][Nick], MAX_PLAYER_NAME);
format(string, SOS, "Admin %s(%d): %s", pInfo[playerid][Nick], playerid, params);
SendClientMessageToAll(0xFFC0CBAA, string);
return 1;
}
Re: Code has errors. Any help ? [URGENT] -
Commands - 01.11.2015
In the above message, when I type something like /asay Hi. The only output is Admin Myname :
There is nothing beyond it. How to fix it like if we write a message.
Re: Code has errors. Any help ? [URGENT] -
ATGOggy - 01.11.2015
pawn Код:
COMMAND:asay(playerid, params[])
{
new message[256], pName[MAX_PLAYER_NAME];
if(isnull(params)) return SendClientMessage(playerid, -1, "ERROR: The correct syntax is /asay [Message]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Only RCON Admins can use the command");
GetPlayerName(playerid, pName, sizeof(pName));
format(message, sizeof(message), "Admin %s(%d): %s", pName, playerid, params);
SendClientMessageToAll(0xFFC0CBAA, message);
return 1;
}