Need help
#1

I'm trying to script a admin duty command, and I have some errors. Those are the errors:

PHP код:
C:\Users\User\Desktop\Premium Roleplay\gamemodes\mysql.pwn(85732) : error 035argument type mismatch (argument 2)
C:\Users\User\Desktop\Premium Roleplay\gamemodes\mysql.pwn(85732) : error 029invalid expressionassumed zero 
there are some warnings, but they do not effect anything.

This is the script

PHP код:
(58732)SendClientMessageToAll(playeridCOLOR_YELLOW"Administrator %s is now on duty. (/report for assistance.")); GetPlayerNameEx(playerid); 
If you want any other line, please reply.

Thank you for your help.
Reply
#2

Quote:

(58732)SendClientMessageToAll(playerid, COLOR_YELLOW, "Administrator %s is now on duty. (/report for assistance.")); GetPlayerNameEx(playerid);

Why do you put a "playerid" in ClientMessageTOALL? I think you should remove it

//edit:
oh wait, you have to format the string, too.

//edit 2:
PHP код:
new string[128];
    new 
AdminName[28];
    
    
GetPlayerName(playeridAdminNamesizeof(AdminName));
    
    
format(stringsizeof(string), "Administrator %s is now on duty. (/report for assistance."AdminName);
    
SendClientMessageToAll(COLOR_YELLOWstring); 
Reply
#3

PHP код:
CMD:adduty(playeridparams[])
{
    new 
string[256];
        new 
AdminName[28];
        
GetPlayerName(playeridAdminNamesizeof(AdminName));
        
format(stringsizeof(string), "Administrator %s is now on duty. (/report for assistance)."AdminName;

    if(
PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playeridCOLOR_GREY,"You are not authorized to use that command.");
    else
    {
        {
            
SetPlayerColor(playeridCOLOR_BLACK);
            
SetPlayerHealth(playerid99999);
            
SetPlayerArmour(playerid99999);
            {
            
SendClientMessage(playeridCOLOR_LIGHTBLUE"You are now administrator On duty .");

            
SendClientMessageToAll(COLOR_YELLOWstring);
            }

        }
    }
    return 
1;

This is what I wrote now

and I get the error, "Excepted token "," but found ";"
Reply
#4

pawn Код:
CMD:adduty(playerid, params[])
{
    new string[256], AdminName[28];
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY,"You are not authorized to use that command.");
    else
    {
        GetPlayerName(playerid, AdminName, sizeof(AdminName));
        format(string, sizeof(string), "Administrator %s is now on duty. (/report for assistance).", AdminName);
        SendClientMessageToAll(COLOR_YELLOW, string);
        SetPlayerColor(playerid, COLOR_BLACK);
        SetPlayerHealth(playerid, 99999);
        SetPlayerArmour(playerid, 99999);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are now administrator On duty .");
    }
    return 1;
}
Use this.
Reply
#5

Thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)