Jump to content
  • 0

(18861) : error 035: argument type mismatch (argument 3)


Wreeper

Question

YCMD:unjail(playerid, params[], help) {
    if(!playerVariables[playerid][pAdmin]) return adminOnly(playerid);
    new id,reason[128];
    
    if(sscanf(params, "uis[128]", id,reason)) return sendUsage(playerid, "/unjail [name/playerid] [reason]");
    if(!isPlayerLogged(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Player not connected.");
    if(playerVariables[id][pJailTime] == 0) return SCM(playerid, COLOR_WHITE, "This player is not in jail.");

    ResetWeapons(id);
    WantedPoints[id] = 0;
    playerVariables[id][pJailed] = 0;
    playerVariables[id][pJailTime] = 0;
    SpawnPlayer(id);

    SendAdminMessage(COLOR_RED2, "Jail: %s was unjailed by %s, reason: %s.", GetName(id), GetName(playerid),reason);
    SCMF(id, COLOR_RED2, "Administrator %s has released you from jail.", GetName(playerid));
    
    UpdateVar( id, "Jailed", playerVariables[ id ][ pJailed ] );
    UpdateVar( id, "JailTime", playerVariables[ id ][ pJailTime ] );
    return 1;
}

 

De ce se intampla asa ceva?

Eroare: (18861) : error 035: argument type mismatch (argument 3)

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Ok si care e linia cu acel warning? Pentru ca vad cateva functii care au 3 argumente care pot produce asta.

Ca idee poate ai ceva gen

Functie (argument1, argument2, Float:argument3)
{
}

Si sa o chemi (acest cod produce warning)

new variabila1, variabila2, variabla3;
Functie(variabila1, variabila2, variabla3);

Iar codul corect sa fie (acest cod nu produce warning)

new variabila1, variabila2, Float:variabla3;
Functie(variabila1, variabila2, variabla3);

 

Link to comment
Share on other sites

  • 0
12 minutes ago, Banditul said:

Ok si care e linia cu acel warning? Pentru ca vad cateva functii care au 3 argumente care pot produce asta.

Ca idee poate ai ceva gen

Functie (argument1, argument2, Float:argument3)
{
}

Si sa o chemi (acest cod produce warning)

new variabila1, variabila2, variabla3;
Functie(variabila1, variabila2, variabla3);

Iar codul corect sa fie (acest cod nu produce warning)

new variabila1, variabila2, Float:variabla3;
Functie(variabila1, variabila2, variabla3);

 

SendAdminMessage(COLOR_RED2, "Jail: %s was unjailed by %s, reason: %s.", GetName(id), GetName(playerid),reason);

Link to comment
Share on other sites

  • 0
22 minutes ago, Wreeper said:

SendAdminMessage(COLOR_RED2, "Jail: %s was unjailed by %s, reason: %s.", GetName(id), GetName(playerid),reason);

In cazul acesta verifica unde ai declarat functia si vezi ce parametri are nevoie. In cazul tau al treilea argument este GetName(id) e posibil ca functia ta sa nu necesite un string sau sa fie gresit facuta.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.