Scripting Compile Errors
#1

Hey guys today I've a problem for the scripting compile errors.
Here they are..
Код:
C:\Users\default.Acer\Desktop\samp03e_svr_R2_win32\gamemodes\samp.pwn(8779) : error 035: argument type mismatch (argument 1)

Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
And here is my script.
It's a offline ban command.
pawn Код:
CMD:offlineban(playerid,params[])
{
    new string[124],string1[124],giveplayername[24];
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        if(sscanf(params, "s", giveplayername)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /offlineban [full name(case sensative)]"); return 1; }
        format(string,sizeof(string),"/Users/%s.ini",params);
        if(fexist(string))
        {
            // This is the line >>> new INI:File = INI_Open(UserPath(string));
            INI_SetTag(File,"data");
            INI_WriteInt(File,"Banned",1);
            INI_Close(File);
            format(string1, sizeof(string1), "* You have sucessfully offline-banned %s from the server.", giveplayername);
            SendClientMessage(playerid,COLOR_YELLOW,string1);
        }
        else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player name specified in the database !");
    }
    else SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
    return 1;
}
I'm not quite sure on how to fix it, it's supposed to be new INI:File = INI_Open(UserPath(playerid)); and then I replaced it to 'string', but it didn't work. I also used this code in a tutorial. I looked at the comments and they had no problem. Not quite sure.I also have tried to rename 'string' to params.It's also supposed to be name 'string' in the tutorial.

If you'd like the link, here.
Reply
#2

pawn Код:
CMD:offlineban(playerid,params[])
{
    new string[124],string1[124],giveplayername[24];
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        if(sscanf(params, "s", giveplayername)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /offlineban [full name(case sensative)]"); return 1; }
        format(string,sizeof(string),"/Users/%s.ini",giveplayername);
        if(fexist(string))
        {
            new INI:File; File = INI_Open(string);
            INI_SetTag(File,"data");
            INI_WriteInt(File,"Banned",1);
            INI_Close(File);
            format(string1, sizeof(string1), "* You have sucessfully offline-banned %s from the server.", giveplayername);
            SendClientMessage(playerid,COLOR_YELLOW,string1);
        }
        else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player name specified in the database !");
    }
    else SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
    return 1;
}
Reply
#3

Quote:
Originally Posted by Feastahashi
Посмотреть сообщение
pawn Код:
CMD:offlineban(playerid,params[])
{
    new string[124],string1[124],giveplayername[24];
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        if(sscanf(params, "s", giveplayername)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /offlineban [full name(case sensative)]"); return 1; }
        format(string,sizeof(string),"/Users/%s.ini",giveplayername);
        if(fexist(string))
        {
            new INI:File; File = INI_Open(string);
            INI_SetTag(File,"data");
            INI_WriteInt(File,"Banned",1);
            INI_Close(File);
            format(string1, sizeof(string1), "* You have sucessfully offline-banned %s from the server.", giveplayername);
            SendClientMessage(playerid,COLOR_YELLOW,string1);
        }
        else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player name specified in the database !");
    }
    else SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
    return 1;
}
Please describe to him what was wrong in the code then only he can understand and use in future
Reply
#4

Quote:
Originally Posted by RedCrossER
Посмотреть сообщение
Please describe to him what was wrong in the code then only he can understand and use in future
No need to man, I can understand right away.

And thanks by the way too the 2 of you guys.

@Feastahashi - +REPed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)