SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 10/03/2016, 07:22 PM   #1
Tass007
Gangsta
 
Tass007's Avatar
 
Join Date: May 2011
Location: Somewhere not near you
Posts: 733
Reputation: 31
Default Warning 202: number of arguments does not match definition

I was editing this gamemode and then all of a sudden these warnings popped up, I didn't touch anything within this area of code so I don't know what's happening... Please help...

Code:
(1569) : warning 202: number of arguments does not match definition
(4687) : warning 202: number of arguments does not match definition
(24980) : warning 202: number of arguments does not match definition
Parts of each of the code
PHP Code:
    new File:file fopen("DroppedGuns.ini"io_read);
    if(
file)
    {
        new 
buffer[256], FileCoords[7][20];
        for(new 
0MAX_OBJg++)
        {
            
fread(filebuffer);
            
split(bufferFileCoords',');
            
dGunData[g][ObjPos][0] = floatstr(FileCoords[0]);
            
dGunData[g][ObjPos][1] = floatstr(FileCoords[1]);
            
dGunData[g][ObjPos][2] = floatstr(FileCoords[2]);
            
dGunData[g][ObjData][0] = strval(FileCoords[3]);
            
dGunData[g][ObjData][1] = strval(FileCoords[4]);
            
dGunData[g][ObjInt] = strval(FileCoords[5]);
            
dGunData[g][ObjWorld] = strval(FileCoords[6]);
            if(
dGunData[g][ObjData][0] > && dGunData[g][ObjData][1] != && dGunData[g][ObjPos][0] != 0)
            {
                
dGunData[g][ObjID] = CreateDynamicObject(GunObjects[dGunData[g][ObjData][0]], dGunData[g][ObjPos][0], dGunData[g][ObjPos][1], dGunData[g][ObjPos][2]-193.7120.0120.0dGunData[g][ObjWorld], dGunData[g][ObjInt], -1200.00.0);
                
printf("* %s loaded: %f,%f,%f,"GunNames[dGunData[g][ObjData][0]], dGunData[g][ObjPos][0], dGunData[g][ObjPos][1], dGunData[g][ObjPos][2]-1);
            }
        }
    } 
Warning line is

PHP Code:
        dGunData[g][ObjID] = CreateDynamicObject(GunObjects[dGunData[g][ObjData][0]], dGunData[g][ObjPos][0], dGunData[g][ObjPos][1], dGunData[g][ObjPos][2]-193.7120.0120.0dGunData[g][ObjWorld], dGunData[g][ObjInt], -1200.00.0); 
Next warning; will post the command it is in.

PHP Code:
CMD:dropgun(playeridparams[])
{
    new
    
world GetPlayerVirtualWorld(playerid), interior GetPlayerInterior(playerid);
    if(
GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
     new 
GunID GetPlayerWeapon(playerid);
      new 
GunAmmo GetPlayerAmmo(playerid);
       if(
GunID && GunAmmo != 0)
    {
        new 
MAX_OBJ+1;
         for(new 
0MAX_OBJa++)
          {
               if(
dGunData[a][ObjPos][0] == 0.0)
             {
                  
a;
                break;
            }
        }
          if(
MAX_OBJ) return SendClientMessage(playeridCOLOR_LIGHTRED"You can not drop your gun at the moment. (max limit exceeded)");
        
RemovePlayerWeapon(playeridGunID);
        
dGunData[f][ObjData][0] = GunID;
        
dGunData[f][ObjData][1] = GunAmmo;
        
        
dGunData[f][ObjInt] = interior;
        
dGunData[f][ObjWorld] = world;
        
        
GetPlayerPos(playeriddGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]);
        
dGunData[f][ObjID] = CreateDynamicObject(GunObjects[GunID], dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]-193.7120.0120.0worldinterior, -1200.00.0);
        new 
buffer[50];
        
format(buffersizeof(buffer), "You threw your %s on the ground."GunNames[dGunData[f][ObjData][0]]);
        
SendClientMessage(playerid, -1buffer);
        
        
// Logging bans
        
new dropgunstring[256];
        
           new 
HourMinuteSecond;
        
gettime(HourMinuteSecond);

        
format(dropgunstringsizeof(dropgunstring), "[%d:%d:%d] %s threw his %s on the ground."HourMinuteSecondGetName(playerid), GunNames[dGunData[f][ObjData][0]]);
        
DropGunLog(dropgunstring);
        
// -------------------------------------------------------
    
}
       return 
1;

Warning line

PHP Code:
        dGunData[f][ObjID] = CreateDynamicObject(GunObjects[GunID], dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]-193.7120.0120.0worldinterior, -1200.00.0); 
Last warning line; part of the code

PHP Code:
stock CreateDroppedGun(GunIDGunAmmoFloat:gPosXFloat:gPosYFloat:gPosZworldinterior)
{
    new 
MAX_OBJ+1;
    for(new 
0MAX_OBJa++)
    {
        if(
dGunData[a][ObjPos][0] == 0.0)
        {
            
a;
            break;
        }
    }
    if(
MAX_OBJ) return;
    
dGunData[f][ObjData][0] = GunID;
    
dGunData[f][ObjData][1] = GunAmmo;
    
dGunData[f][ObjPos][0] = gPosX;
    
dGunData[f][ObjPos][1] = gPosY;
    
dGunData[f][ObjPos][2] = gPosZ;
    
dGunData[f][ObjInt] = interior;
    
dGunData[f][ObjWorld] = world;
    
dGunData[f][ObjID] = CreateDynamicObject(GunObjects[GunID], dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]-193.7120.0120.0dGunData[f][ObjWorld], dGunData[f][ObjInt], -1200.00.0);
    return;

You can probably guess where the warning is... but the warning line is

PHP Code:
    dGunData[f][ObjID] = CreateDynamicObject(GunObjects[GunID], dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]-193.7120.0120.0dGunData[f][ObjWorld], dGunData[f][ObjInt], -1200.00.0); 
Thanks in advance to whom ever helps me.

As always who ever helps will get +1 Rep.

Thanks Tass.
__________________
Copyright 2016 vR Studios
Currently working with vR Studios
Copying and pasting doesn't allow you to learn the things that reading and understanding will.
Tass007 is offline   Reply With Quote
Old 10/03/2016, 08:36 PM   #2
AdmBot
Big Clucker
 
Join Date: Oct 2014
Location: Bucharest, Romania.
Posts: 61
Reputation: 15
Default Re: Warning 202: number of arguments does not match definition

Check the parameters of CreateDynamicObject:
Code:
native STREAMER_TAG_OBJECT CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1);
AdmBot is offline   Reply With Quote
Old 10/03/2016, 08:45 PM   #3
Tass007
Gangsta
 
Tass007's Avatar
 
Join Date: May 2011
Location: Somewhere not near you
Posts: 733
Reputation: 31
Default Re: Warning 202: number of arguments does not match definition

I fixed it thanks.
__________________
Copyright 2016 vR Studios
Currently working with vR Studios
Copying and pasting doesn't allow you to learn the things that reading and understanding will.
Tass007 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
warning 202: number of arguments does not match definition [sFx]BlueSmoke Scripting Help 16 19/01/2015 10:16 AM
warning 202: number of arguments does not match definition Cr3dO Scripting Help 2 30/12/2014 09:56 AM
Help: warning 202: number of arguments does not match definition KingPersona Scripting Help 1 10/10/2014 01:18 PM
warning 202: number of arguments does not match definition Lirbo Scripting Help 2 04/07/2014 11:45 PM
warning 202: number of arguments does not match definition Dripac Scripting Help 0 16/04/2012 11:13 AM


All times are GMT. The time now is 12:11 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.