PDA

View Full Version : warning 202: number of arguments does not match definition


lulo356
21/03/2014, 08:12 PM
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]);

C:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202: number of arguments does not match definition
C:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202: number of arguments does not match definition
C:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202: number of arguments does not match definition
C:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202: number of arguments does not match definition
C:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202: number of arguments does not match definition
C:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202: number of arguments does not match definition
C:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202: number of arguments does not match definition
C:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202: number of arguments does not match definition
C:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202: number of arguments does not match definition
C:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202: number of arguments does not match definition
C:\Users\Davey\Desktop\BC RP\gamemodes\BCRP.pwn(10140) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


11 Warnings.

Can someone help me please

BigBrainAFK
21/03/2014, 08:21 PM
post the RandomAPrision Enum pls

xser
21/03/2014, 08:22 PM
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)

SetPlayerPos(playerid,Float:x,Float:y,Float:z)

1. Create an array.
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.
public OnPlayerSpawn(playerid)
{
new Random = random(sizeof(RandomAPrison));
SetPlayerPos(playerid, RandomAPrison[Random][0], RandomAPrison[Random][1], RandomAPrison[Random][2]);
return 1;
}

lulo356
21/03/2014, 08:23 PM
CMD:arrest(playerid, params[])
{
new rand = random(sizeof(RandomAPrison));
new playerb, time, string[128], fine;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO.");
if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(!IsPlayerNearArrestPoint(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the arrest point.");
if(sscanf(params, "uis[64]", playerb, time, fine)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /arrest [playerid] [minutes] [price]");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(fine <=0 || fine > 5000)return SendClientMessage(playerid, COLOR_GREY, "Invalid money amount(0-5000).");
if(!PlayerInfo[playerb][pWanted]) return SendClientMessage(playerid, COLOR_GREY, "Player is not wanted.");
if(IsACop(playerb) && IsFBI(playerb) && IsARES(playerb)) return SendClientMessage(playerid, COLOR_GREY, "You can't arrest an BCPD Officer.");
if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are too far away from that player.");
format(string, sizeof(string), "Local Prison: %s has been arrested by %s.", RPN(playerb), RPN(playerid));
foreach(Player, i)
{
if(IsACop(i) || IsFBI(i) || IsARES(i))
{
SendClientMessage(i, COLOR_BLUE, string);
}
}
SetPlayerColor(playerb, TRANSPARENT_ORANGE);
PlayerInfo[playerb][pArrested] ++;
PlayerInfo[playerb][pPrison] = 2;
PlayerInfo[playerb][pPrisonTime] = time*60;
GiveDodMoney(playerb, -fine);
ClearDodWantedLevels(playerb);
SetPlayerInterior(playerb, 0);
SetPlayerVirtualWorld(playerb, 0);
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]);
SetPlayerFacingAngle(playerb, 90.0);
TogglePlayerControllable(playerb, 0);
SetTimerEx("EnterExitTimer", 5000, false, "i", playerb);
SetCameraBehindPlayer(playerb);
format(string, sizeof(string), " You have been arrested by an officer for %d minutes (%d seconds) and fined $%d", PlayerInfo[playerb][pPrisonTime]/60, PlayerInfo[playerb][pPrisonTime], fine);
SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
RemovePlayerAttachedObject(playerb, 0);
SetPlayerSpecialAction(playerb, SPECIAL_ACTION_NONE);

MP2
21/03/2014, 08:31 PM
SetPlayerPos has four parameters - playerid, x, y and z. Why are you passing like 500?

xser
21/03/2014, 08:31 PM
Yeah, just change:
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

SetPlayerPos(playerid, RandomAPrison[rand][0], RandomAPrison[rand][1], RandomAPrison[rand][2]);