Change?
#1

How can i change SERVER:Unkown command. I did search ****** but all or OnPlayerCommandText and I don't have return 0; in my code. Here is mine:
Just one example from the script.
pawn Код:
YCMD:kick(playerid, params[], help)
{
        #pragma unused help
        if(P_Data[playerid][pAdmin] == 0) return SCM(playerid, COLOR_RED, "You are not an administrator!");
        new
            string[128],pplayerid, reason[48];
        if(sscanf(params, "us[48]", pplayerid, reason)) return SCM(playerid, COLOR_RED, "Usage: /kick [Player ID/Player Name] [Reason]");
        if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
        if(P_Data[pplayerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You can't ban admin level 5!");
        format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"is kick player "COL_WHITE"%s  "COL_RED"Reason: %s",GetName(playerid),GetName(pplayerid),reason);
        SCMToAll(-1,string);
        Kick(pplayerid);
        return 1;
}
Reply
#2

OnPlayerCommandPerformed

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return //The message here. such as SendClientMessage(...);
        //Checks if the command executing is failed. (Doesn't exist)
    return 1;
}
Reply
#3

Like
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid, COLOR_RED, "This command is not available!");
        //Checks if the command executing is failed. (Doesn't exist)
       // I don't know what to do with ^^this part
    return 1;
}
Reply
#4

Yes correct.
Remove the comment

remove this

pawn Код:
//Checks if the command executing is failed. (Doesn't exist)
       // I don't know what to do with ^^this part
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)