SA-MP Forums Archive
warning 202: number of arguments does not match definition - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: warning 202: number of arguments does not match definition (/showthread.php?tid=502019)



warning 202: number of arguments does not match definition - lulo356 - 21.03.2014

Quote:

SetPlayerPos(playerid, RandomAPrison[rand][0], RandomAPrison[rand][1],RandomAPrison[rand][2], RandomAPrison[rand][3], RandomAPrison[rand][4],RandomAPrison[rand][5], RandomAPrison[rand][6], RandomAPrison[rand][7],RandomAPrison[rand][8], RandomAPrison[rand][9], RandomAPrison[rand][10],RandomAPrison[rand][11], RandomAPrison[rand][12], RandomAPrison[rand][13]);

PHP код:
C:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202number of arguments does not match definition
C
:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202number of arguments does not match definition
C
:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202number of arguments does not match definition
C
:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202number of arguments does not match definition
C
:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202number of arguments does not match definition
C
:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202number of arguments does not match definition
C
:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202number of arguments does not match definition
C
:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202number of arguments does not match definition
C
:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202number of arguments does not match definition
C
:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202number of arguments does not match definition
C
:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202number of arguments does not match definition
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
11 Warnings

Can someone help me please


Re: warning 202: number of arguments does not match definition - BigBrainAFK - 21.03.2014

post the RandomAPrision Enum pls


Re: warning 202: number of arguments does not match definition - xser - 21.03.2014

I assume you're trying to make random spawns for players, that's not how its done. (You're not using SetPlayerPos correctly for your enum)

pawn Код:
SetPlayerPos(playerid,Float:x,Float:y,Float:z)
1. Create an array.
pawn Код:
new Float:RandomAPrison[][] =
{
   {    x   ,     y     ,   z  } //Replace X Y Z with your cords
   {    x   ,     y     ,   z  } //Replace X Y Z with your cords
   {    x   ,     y     ,   z  } //Replace X Y Z with your cords (You can keep adding random spawn cords . .)
};
2. Find OnPlayerSpawn and do the following.
pawn Код:
public OnPlayerSpawn(playerid)
{
    new Random = random(sizeof(RandomAPrison));
    SetPlayerPos(playerid, RandomAPrison[Random][0], RandomAPrison[Random][1], RandomAPrison[Random][2]);
    return 1;
}



Re: warning 202: number of arguments does not match definition - lulo356 - 21.03.2014

PHP код:
CMD:arrest(playeridparams[])
{
    new 
rand random(sizeof(RandomAPrison));
    new 
playerbtimestring[128], fine;
       if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(!
IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not a LEO.");
    if(!
PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playeridCOLOR_GREY"You are not on duty.");
    if(!
IsPlayerNearArrestPoint(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not near the arrest point.");
    if(
sscanf(params"uis[64]"playerbtimefine)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /arrest [playerid] [minutes] [price]");
    if(!
IsPlayerLoggedIn(playerb)) return SendClientMessage(playeridCOLOR_GREY"Invalid player id.");
    if(
fine <=|| fine 5000)return SendClientMessage(playeridCOLOR_GREY"Invalid money amount(0-5000).");
    if(!
PlayerInfo[playerb][pWanted]) return SendClientMessage(playeridCOLOR_GREY"Player is not wanted.");
    if(
IsACop(playerb) && IsFBI(playerb) && IsARES(playerb)) return SendClientMessage(playeridCOLOR_GREY"You can't arrest an BCPD Officer.");
    if(!
IsPlayerNearPlayer(playeridplayerb2)) return SendClientMessage(playeridCOLOR_GREY"You are too far away from that player.");
    
format(stringsizeof(string), "Local Prison: %s has been arrested by %s."RPN(playerb), RPN(playerid));
    foreach(
Playeri)
    {
        if(
IsACop(i) || IsFBI(i) || IsARES(i))
        {
            
SendClientMessage(iCOLOR_BLUEstring);
        }
    }
    
SetPlayerColor(playerbTRANSPARENT_ORANGE);
    
PlayerInfo[playerb][pArrested] ++;
    
PlayerInfo[playerb][pPrison] = 2;
    
PlayerInfo[playerb][pPrisonTime] = time*60;
    
GiveDodMoney(playerb, -fine);
    
ClearDodWantedLevels(playerb);
    
SetPlayerInterior(playerb0);
    
SetPlayerVirtualWorld(playerb0);
    
SetPlayerPos(playeridRandomAPrison[rand][0], RandomAPrison[rand][1], RandomAPrison[rand][2], RandomAPrison[rand][3], RandomAPrison[rand][4], RandomAPrison[rand][5], RandomAPrison[rand][6], RandomAPrison[rand][7], RandomAPrison[rand][8], RandomAPrison[rand][9], RandomAPrison[rand][10], RandomAPrison[rand][11], RandomAPrison[rand][12], RandomAPrison[rand][13]);
    
SetPlayerFacingAngle(playerb90.0);
    
TogglePlayerControllable(playerb0);
    
SetTimerEx("EnterExitTimer"5000false"i"playerb);
     
SetCameraBehindPlayer(playerb);
    
format(stringsizeof(string), " You have been arrested by an officer for %d minutes (%d seconds) and fined $%d"PlayerInfo[playerb][pPrisonTime]/60PlayerInfo[playerb][pPrisonTime], fine);
    
SendClientMessage(playerbCOLOR_LIGHTBLUEstring);
    
RemovePlayerAttachedObject(playerb0);
    
SetPlayerSpecialAction(playerbSPECIAL_ACTION_NONE); 



Re: warning 202: number of arguments does not match definition - MP2 - 21.03.2014

SetPlayerPos has four parameters - playerid, x, y and z. Why are you passing like 500?


Re: warning 202: number of arguments does not match definition - xser - 21.03.2014

Yeah, just change:
pawn Код:
SetPlayerPos(playerid, RandomAPrison[rand][0], RandomAPrison[rand][1], RandomAPrison[rand][2], RandomAPrison[rand][3], RandomAPrison[rand][4], RandomAPrison[rand][5], RandomAPrison[rand][6], RandomAPrison[rand][7], RandomAPrison[rand][8], RandomAPrison[rand][9], RandomAPrison[rand][10], RandomAPrison[rand][11], RandomAPrison[rand][12], RandomAPrison[rand][13]);
To

pawn Код:
SetPlayerPos(playerid, RandomAPrison[rand][0], RandomAPrison[rand][1], RandomAPrison[rand][2]);