Code has errors. Any help ? [URGENT]
#1

PHP код:
COMMAND:asay(playeridparams[])
{
    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(playeridpInfo[playerid][Nick], 20);
    
format(stringSOS"Admin %s: %s"pInfo[playerid][Nick], playeridAnnounce);
    
SendClientMessageToAll(0xFFC0CBAAstring);
    return 
1;

Uhm..the code shows no errors while compiling but some weird effects IG. How to fix ?
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)