SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 17/03/2015, 05:04 AM   #1
Mya
Banned
 
Join Date: Mar 2015
Location: In Here
Posts: 72
Reputation: 11
Default [HELP]warning 202: number of arguments does not match definition

Hi,
i got 3 problem about warning 202: number of arguments does not match definition

this is line
PHP Code:
CMD:drift1(playeridparams[])
{
    
SetPlayerPos(playerid5924,-4716.8574,112.5937,263); // << This IS 1
    
SendClientMessageToAll(playeridBLUE"Has gone to /drift1"); << This Is 2
        GameTextForPlayer
(playerid"Welcome To Drift1"30005);
    new 
string[128], pName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
    
format(stringsizeof(string), "~r~%s ~w~has Teleported to ~y~/drift1",pName);
     
SetPlayerVirtualWorld(playerid0);
    return 
1;

PHP Code:
F:\My Documents\Unduhan\Mya\gamemodes\Build9.pwn(2946) : warning 202number of arguments does not match definition
F
:\My Documents\Unduhan\Mya\gamemodes\Build9.pwn(4405) : warning 202number of arguments does not match definition
F
:\My Documents\Unduhan\Mya\gamemodes\Build9.pwn(4406) : warning 202number of arguments does not match definition 
And

PHP Code:
    #define DIALOG_DRIFT                                            62
if(dialogid == DIALOG_DRIFT)
    {
        if(
response)
        {
            if(
listitem == 0cmd_drift1(playerid); // << This IS 3
        
}
    } 
Thanks. And Please Help Me.
Mya is offline   Reply With Quote
Old 17/03/2015, 05:06 AM   #2
X337
Gangsta
 
Join Date: Sep 2014
Location: Indonesia
Posts: 872
Reputation: 291
Default Re: [HELP]warning 202: number of arguments does not match definition

Change
Code:
SetPlayerPos(playerid, 5924,-4716.8574,112.5937,263);
to
Code:
SetPlayerPos(playerid, 5924.000,-4716.8574,112.5937);
I see 5 parameter on your SetPlayerPos, see this http://wiki.sa-mp.com/wiki/SetPlayerPos

and remove playerid, from SendClientMessageToAll
Code:
SendClientMessageToAll(BLUE, "Has gone to /drift1");
__________________
viva la sa-mp
X337 is offline   Reply With Quote
Old 17/03/2015, 05:17 AM   #3
Mya
Banned
 
Join Date: Mar 2015
Location: In Here
Posts: 72
Reputation: 11
Default Re: [HELP]warning 202: number of arguments does not match definition

Quote:
Originally Posted by bondowocopz View Post
Change
Code:
SetPlayerPos(playerid, 5924,-4716.8574,112.5937,263);
to
Code:
SetPlayerPos(playerid, 5924.000,-4716.8574,112.5937);
I see 5 parameter on your SetPlayerPos, see this http://wiki.sa-mp.com/wiki/SetPlayerPos

and remove playerid, from SendClientMessageToAll
Code:
SendClientMessageToAll(BLUE, "Has gone to /drift1");
Thanks, All already fixed
Mya is offline   Reply With Quote
Old 17/03/2015, 05:17 AM   #4
JaKe Elite
High-roller
 
JaKe Elite's Avatar
 
Join Date: Apr 2012
Location: Philippines
Posts: 3,715
Reputation: 489
Default Re: [HELP]warning 202: number of arguments does not match definition

Additional help, If you want your 5th parameter which is Angle to be added on teleporting.

Just do this.

Add this below SetPlayerPos

pawn Code:
SetPlayerFacingAngle(playerid, 263);
__________________
Discord: Cipher#7353
__________________


Server IP: Click me | Discord: Click me
JaKe Elite is offline   Reply With Quote
Old 17/03/2015, 05:21 AM   #5
X337
Gangsta
 
Join Date: Sep 2014
Location: Indonesia
Posts: 872
Reputation: 291
Default Re: [HELP]warning 202: number of arguments does not match definition

Code:
SetPlayerFacingAngle(playerid, 263.0);
Second arguments must be Float, mate
__________________
viva la sa-mp
X337 is offline   Reply With Quote
Old 17/03/2015, 08:01 AM   #6
ATGOggy
Gangsta
 
Join Date: Sep 2014
Location: Ls-rcr
Posts: 850
Reputation: 52
Default Re: [HELP]warning 202: number of arguments does not match definition

There's one more error:
PHP Code:
if(listitem == 0cmd_drift1(playerid
Change it to:
PHP Code:
if(listitem == 0cmd_drift1(playerid""
__________________
******: "I've said this before. People think that MySQL is some simple plug-and-play magic bullet that you can use to just make your mode instantly better. They don't realise that the "L" in "SQL" means "language". So instead of programming PAWN, and using a bit of this mystery thing, you are now programming in two languages at once. If you spend months learning PAWN, you should spend the same time learning SQL, if not more - it is probably the more complex of the two languages, and not something that just gets bolted on to the side."


I give and want only fair reps. I hate this: "hey bro, I rep you, rep me plz

Click below if you wanna be amazed:
http://Paid2Refer.com/ref.php?refId=291262
ATGOggy is offline   Reply With Quote
Old 17/03/2015, 09:20 AM   #7
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,830
Reputation: 114
Default Re: [HELP]warning 202: number of arguments does not match definition

Quote:
Originally Posted by bondowocopz View Post
Code:
SetPlayerFacingAngle(playerid, 263.0);
Second arguments must be Float, mate
There's no difference of 263.0, and 263.
Like there's no difference of 1.010 and 1.01, i could do 263.00000, and it's still the same as 263.
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Old 17/03/2015, 09:25 AM   #8
X337
Gangsta
 
Join Date: Sep 2014
Location: Indonesia
Posts: 872
Reputation: 291
Default Re: [HELP]warning 202: number of arguments does not match definition

Quote:
Originally Posted by CalvinC View Post
There's no difference of 263.0, and 263.
Like there's no difference of 1.010 and 1.01, i could do 263.00000, and it's still the same as 263.
Sorry, i think second arguments must be Float and you get warning when you use an integer.
__________________
viva la sa-mp
X337 is offline   Reply With Quote
Old 17/03/2015, 10:23 AM   #9
Mya
Banned
 
Join Date: Mar 2015
Location: In Here
Posts: 72
Reputation: 11
Default Re: [HELP]warning 202: number of arguments does not match definition

Quote:
Originally Posted by CalvinC View Post
There's no difference of 263.0, and 263.
Like there's no difference of 1.010 and 1.01, i could do 263.00000, and it's still the same as 263.
Quote:
Originally Posted by bondowocopz View Post
Sorry, i think second arguments must be Float and you get warning when you use an integer.
Quote:
Originally Posted by ATGOggy View Post
There's one more error:
PHP Code:
if(listitem == 0cmd_drift1(playerid
Change it to:
PHP Code:
if(listitem == 0cmd_drift1(playerid""
Quote:
Originally Posted by bondowocopz View Post
Code:
SetPlayerFacingAngle(playerid, 263.0);
Second arguments must be Float, mate
Quote:
Originally Posted by JaKe Elite View Post
Additional help, If you want your 5th parameter which is Angle to be added on teleporting.

Just do this.

Add this below SetPlayerPos

pawn Code:
SetPlayerFacingAngle(playerid, 263);
ok Jake, Thanks for additional help
-----------------------------------------------------------------------------------------------------------------------------

All warnings allraedy fixed, thanks all
Mya is offline   Reply With Quote
Old 17/03/2015, 11:32 AM   #10
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,066
Reputation: 2660
Default Re: [HELP]warning 202: number of arguments does not match definition

Quote:
Originally Posted by CalvinC View Post
There's no difference of 263.0, and 263.
That is actually not true, at all. If you insert an integer where a float is expected Pawn will implicitly convert it. Many other languages, however, require you to explicitly specify the ".0" otherwise the value will be treated as an integer.

Say, if you did:
Code:
new result = 10 / 3;
result would be 3. Not 3.33333. Just 3.

Whereas if you did:
Code:
new result = 10 / 3.0;
You would get a tag mismatch warning because result is not a floating point number.

http://en.wikipedia.org/wiki/IEEE_754

You should always add the .0 when dealing with floats to prevent preventable errors.
__________________
Vince 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
[Ajuda] warning 202: number of arguments does not match definition Mirathir Português/Portuguese 1 12/02/2015 03:32 AM
[HELP] warning 202: number of arguments does not match definition GBLTeam Scripting Help 3 18/11/2014 12:58 PM
warning 202: number of arguments does not match definition Slicebook Scripting Help 3 04/04/2014 10:48 PM
(Help)warning 202: number of arguments does not match definition NTVbeleza Scripting Help 2 12/03/2014 05:22 PM
warning 202: number of arguments does not match definition TomRedlake Scripting Help 9 09/08/2013 10:20 AM


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


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