need help with 2 warnings and 2 errors
#1

Quote:

C:\Users\USER\Desktop\Street Kings Server\SKCNR (3).pwn(6179) : error 001: expected token: ",", but found ";"
C:\Users\USER\Desktop\Street Kings Server\SKCNR (3).pwn(8177) : warning 202: number of arguments does not match definition
C:\Users\USER\Desktop\Street Kings Server\SKCNR (3).pwn(8177) : error 001: expected token: ")", but found "-identifier-"
C:\Users\USER\Desktop\Street Kings Server\SKCNR (3).pwn(8177) : warning 202: number of arguments does not match definition

6179: GetPlayerName(issuerid, leName, sizeof(leName);
Comes from..
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    KillTimer(MoreThan20HPTimer[playerid]);
    KillTimer(LowerHPTimer[playerid]);
    new Float:hp;
    GetPlayerHealth(playerid,hp);
    hp -= amount;

    if(hp <= 20)
    {
        TogglePlayerControllable (playerid,0);
        ApplyAnimation(playerid,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
        SetPlayerArmedWeapon(playerid,0);
        GameTextForPlayer(playerid, "~r~You are injured! Call /911 for EMS!", 10000, 3);
        MoreThan20HPTimer[playerid] = SetTimerEx("MoreThan20HP",1000,true,"i",playerid);
        LowerHPTimer[playerid] = SetTimerEx("LowerHP",4000,true,"i",playerid);
        Injured[playerid] = 1;
    }
    if(weaponid == 23) //silenced pistol
    {
        if(gTeam[issuerid] == SAPD || gTeam[issuerid] == SASD || gTeam[issuerid] == SWAT || gTeam[issuerid] == FBI || gTeam[issuerid] == ARMY || gTeam[issuerid] == DRT || gTeam[issuerid] == SADOC)
        {
            new string[128];
            new leName[MAX_PLAYER_NAME];
            GetPlayerName(issuerid, leName, sizeof(leName);
            format(string, sizeof(string), "You've been tazed by %s and you are unable to move.", leName);
            SendClientMessage(playerid, -1, string);

            TogglePlayerControllable(playerid, 0); //freeze player
            ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 20000, 0);
            SetTimerEx("Untaze", 20000, false, "i", playerid);
        }
    }
8177: if(IsPlayerAttachedObjectSlotUsed(strval(tmp)) RemovePlayerAttachedObject(strval(tmp));
Comes from..
pawn Код:
if(strcmp(cmd, "/arrest", true) == 0 || strcmp(cmd, "/ar", true) == 0)
        {
        new string[128];
        new ID;
    if(IsSpawned[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
        return 1;
    }

    if(gTeam[playerid] != SAPD && gTeam[playerid] != SASD && gTeam[playerid] != SWAT && gTeam[playerid] != ARMY && gTeam[playerid] != FBI && gTeam[playerid] != SADOC)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You are not a Law Enforcement officer ");
        return 1;
    }

    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
        SendClientMessage(playerid, COLOR_ERROR, "USAGE: /(ar)rrest (id)");
        return 1;
    }
    giveplayerid = strval(tmp);
    if(!IsNumeric(tmp))
        {
        SendClientMessage(playerid, COLOR_ERROR, "USAGE: /(ar)rrest (id)");
        return 1;
    }
    if(!IsPlayerConnected(giveplayerid))
        {
        format(string, sizeof(string), "ID (%d) is not connected to the server.", giveplayerid);
        SendClientMessage(playerid, COLOR_ERROR, string);
        return 1;
    }

    new oname[24];
    new pname[24];
    GetPlayerName(playerid,oname, 24);
    GetPlayerName(giveplayerid, pname, 24);


        if(IsCuffed[giveplayerid] == 0)
        {
            format(string,sizeof(string),"%s(%d) is not cuffed. You have to cuff the suspect first!",PlayerName(ID),ID);
            SendClientMessage(playerid,COLOR_ERROR,string);
            return 1;
        }


        if(GetPlayerWantedLevel(giveplayerid) <= 3)
        {
                format(string, sizeof(string), "%s(%d) does not have a warrant. You cannot arrest a player without a warrant",pname,giveplayerid);
                SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(IsPlayerInAnyVehicle(playerid))
        {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest a suspect if you are in a car");
        return 1;
    }
    if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 10)
    {
    format(string, sizeof(string), "%s(%d) is too far away. You cannot arrest that player",pname,giveplayerid);
    SendClientMessage(playerid,COLOR_ERROR,string);
    return 1;
    }
    if(IsSpawned[giveplayerid] == 0)
        {
    format(string, sizeof(string), "%s(%d) is dead. You cannot arrest a dead body",pname,giveplayerid);
    SendClientMessage(playerid,COLOR_ERROR,string);
    return 1;
    }
    SetPlayerVirtualWorld(giveplayerid,0);
    if(GetPlayerWantedLevel(playerid) >=1)
        {
    SendClientMessage(playerid,COLOR_ERROR,"You cannot use this command if you are wanted by the police");
    return 1;
    }
    if(giveplayerid == playerid)
        {
    SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest yourself");
    return 1;
    }
    new spawn = random(sizeof(PrisonSpawn)), string2[250], Float:health, copname[MAX_PLAYER_NAME], arrested[MAX_PLAYER_NAME];
    GetPlayerName(playerid, copname, sizeof(copname));
    GetPlayerName(strval(tmp), arrested, sizeof(arrested));
    GetPlayerHealth(strval(tmp), health);
        SendClientMessage(strval(tmp), GREY, "|_| San Andreas Police Dept. |_|");
        format(string, sizeof(string), "You have been arrested by Law Enforcement Officer %s (%d).", copname);
        SendClientMessage(strval(tmp), WHITE, string);
        ResetPlayerWeapons(strval(tmp));
        SetPlayerPos(strval(tmp), PrisonSpawn[spawn][0], PrisonSpawn[spawn][1], PrisonSpawn[spawn][2]);
        SetPlayerFacingAngle(strval(tmp), PrisonSpawn[spawn][3]);
        SetCameraBehindPlayer(strval(tmp));
        if(GetPlayerWantedLevel(strval(tmp)) >= 4 && GetPlayerWantedLevel(strval(tmp)) <= 5)
        {
        PrisonTime[strval(tmp)] = 150;
        SendClientMessage(playerid, ORANGE, "You earned $6500 and 1 score for arresting the criminal!");
        GivePlayerMoney(playerid,6500);
        GivePlayerScore(playerid,1);
        PlayerInfo[playerid][pArrests]++;
        PlayerPlaySound(playerid, 1130, 0, 0, 0);
        }
        else if(GetPlayerWantedLevel(strval(tmp)) >= 6 && GetPlayerWantedLevel(strval(tmp)) <= 8)
        {
        PrisonTime[strval(tmp)] = 250;
        SendClientMessage(playerid, ORANGE, "You earned $9500 and 1 score for arresting the criminal!");
        GivePlayerMoney(playerid,9500);
        GivePlayerScore(playerid,1);
        PlayerInfo[playerid][pArrests]++;
        PlayerPlaySound(playerid, 1130, 0, 0, 0);
        }
        else if(GetPlayerWantedLevel(strval(tmp)) >= 9 && GetPlayerWantedLevel(playerid) <= 11)
        {
        PrisonTime[strval(tmp)] = 350;
        SendClientMessage(playerid, ORANGE, "You earned $15000 and 2 scores for arresting the criminal!");
        GivePlayerMoney(playerid,15000);
        GivePlayerScore(playerid,2);
        PlayerInfo[playerid][pArrests]++;
        PlayerPlaySound(playerid, 1130, 0, 0, 0);
        }
        else if(GetPlayerWantedLevel(strval(tmp)) >= 12 && GetPlayerWantedLevel(strval(tmp)) <= 14)
        {
        PrisonTime[strval(tmp)] = 450;
        SendClientMessage(playerid, ORANGE, "You earned $19500 and 2 scores for arresting the criminal!");
        GivePlayerMoney(playerid,23500);
        GivePlayerScore(playerid,2);
        PlayerInfo[playerid][pArrests]++;
        PlayerPlaySound(playerid, 1130, 0, 0, 0);
        }
        else if(GetPlayerWantedLevel(strval(tmp)) >= 15)
        {
        PrisonTime[strval(tmp)] = 500;
        SendClientMessage(playerid, ORANGE, "You earned $23000 and 3 scores for arresting the criminal!");
        GivePlayerMoney(playerid,23000);
        GivePlayerScore(playerid,3);
        PlayerInfo[playerid][pArrests]++;
        PlayerPlaySound(playerid, 1130, 0, 0, 0);
        }
        SetPlayerWantedLevel(strval(tmp), 0);
        SetPlayerInterior(strval(tmp),0);
        SetPlayerHealth(strval(tmp),100);
        TogglePlayerControllable(strval(tmp), true);
        SetPlayerJailed(strval(tmp), true);
        PlayerInfo[strval(tmp)][pArrested]++;
        format(string2, sizeof(string2), "Law Enforcement Officer %s (%d) has arrested Wanted Suspect %s (%d).", copname, playerid, arrested, strval(tmp));
        Announce(string2);
        if(health <= 90)
        {
        SendClientMessage(strval(tmp), GREY, "- San Andreas Police Department -");
        SendClientMessage(strval(tmp), GREY, "You have been arrested. You'll be released soon.");
        SetPlayerHealth(strval(tmp), health+10);
        if(IsPlayerAttachedObjectSlotUsed(strval(tmp)) RemovePlayerAttachedObject(strval(tmp));
        SetPlayerSpecialAction(strval(tmp), SPECIAL_ACTION_NONE);
        DynUpdateStart(strval(tmp));
        IsCuffed[strval(tmp)] =0;
        ApplyAnimation(strval(tmp), "FOOD", "EAT_Burger", 4.0, 0, 0, 0, 0, 0);
        }
        return 1;
}
Reply
#2

Change:
pawn Код:
GetPlayerName(issuerid, leName, sizeof(leName);
to:
pawn Код:
GetPlayerName(issuerid, leName, sizeof(leName));
and:
pawn Код:
if(IsPlayerAttachedObjectSlotUsed(strval(tmp))
to:
pawn Код:
if(IsPlayerAttachedObjectSlotUsed(playerid, strval(tmp)))
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Change:
pawn Код:
GetPlayerName(issuerid, leName, sizeof(leName);
to:
pawn Код:
GetPlayerName(issuerid, leName, sizeof(leName));
and:
pawn Код:
if(IsPlayerAttachedObjectSlotUsed(strval(tmp))
to:
pawn Код:
if(IsPlayerAttachedObjectSlotUsed(playerid, strval(tmp)))
(8362) : warning 202: number of arguments does not match definition

Quote:

if(IsPlayerAttachedObjectSlotUsed(playerid, strval(tmp))) RemovePlayerAttachedObject(strval(tmp));

Reply
#4

pawn Код:
RemovePlayerAttachedObject(strval(tmp));
to:
pawn Код:
RemovePlayerAttachedObject(playerid, strval(tmp));
Reply
#5

Thanks alot. +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)