SA-MP Forums Archive
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: Number of Arguments does not match definition! (/showthread.php?tid=564619)



Number of Arguments does not match definition! - ChromeAmazing - 22.02.2015

I get an error on this line, and I can't figure out why...

Код:
ProxDetector(20, playerid, string, 0xE6E6E6E6, 0xC8C8C8C8, 0xAAAAAAAA, 0x8C8C8C8C, 0x6E6E6E6E);
Код:
C:\Users\OfficerHotStuff\Desktop\Roleplay GameMode\gamemodes\roleplay.pwn(769) : warning 202: number of arguments does not match definition
C:\Users\OfficerHotStuff\Desktop\Roleplay GameMode\gamemodes\roleplay.pwn(769) : warning 202: number of arguments does not match definition
C:\Users\OfficerHotStuff\Desktop\Roleplay GameMode\gamemodes\roleplay.pwn(769) : warning 202: number of arguments does not match definition
C:\Users\OfficerHotStuff\Desktop\Roleplay GameMode\gamemodes\roleplay.pwn(769) : warning 202: number of arguments does not match definition



Re: Number of Arguments does not match definition! - xXSPRITEXx - 22.02.2015

It this located under - OnPlayerText?

If so, make sure it returns 0. Not 1.


Re: Number of Arguments does not match definition! - ChromeAmazing - 22.02.2015

It returns 0, here's just some of the code.

Код:
public OnPlayerText(playerid, text[])
{
    new string[128];
    format(string, sizeof(string), "%s says: %s", RemoveUnderScore(playerid), text);
    ProxDetector(20, playerid, string, 0xE6E6E6E6, 0xC8C8C8C8, 0xAAAAAAAA, 0x8C8C8C8C, 0x6E6E6E6E);
    format(string, sizeof(string), "%s", text);
    SetPlayerChatBubble(playerid, string, WHITE, 20.0, 10000);
    return 0;
}



Re: Number of Arguments does not match definition! - zork - 22.02.2015

Код:
ProxDetector(20.0, playerid, string, 0xE6E6E6E6, 0xC8C8C8C8, 0xAAAAAAAA, 0x8C8C8C8C, 0x6E6E6E6E);
Try also defining those colors. I don't know what else it could be because it all looks OK for me.


Re: Number of Arguments does not match definition! - xXSPRITEXx - 22.02.2015

Try this:
Use these defines:
PHP код:
#define COLOR_FADE1 0xFFFFFFFF
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E 
PHP код:
public OnPlayerText(playerid, text[])
{
    new 
pname[24], str[128];
    
GetPlayerName(playerid, pname, 24);
    
format(str, sizeof(str), "%s Says: %s", RemoveUnderScore(playerid), text);
    
ProxDetector(20.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    
format(string, sizeof(string), "%s", text);
    
SetPlayerChatBubble(playerid, string, WHITE, 20.0, 10000);
    return 
0;
} 
Edit: Took this out of my GM(Updated it to your needs)


Re: Number of Arguments does not match definition! - ChromeAmazing - 22.02.2015

Still doesn't work.


Re: Number of Arguments does not match definition! - xXSPRITEXx - 22.02.2015

I just updated my code. It worked quite well for me with no errors/warnings. I suggest it.


Re: Number of Arguments does not match definition! - ChromeAmazing - 22.02.2015

Tried it, still warnings.


Re: Number of Arguments does not match definition! - xXSPRITEXx - 22.02.2015

Make sure this is what the rest of the code looks like:
PHP код:
ProxDetector(Float:radi, playerid, string[], col1, col2, col3, col4, col5)
{
    new 
Float:pPositionX[3], Float:oPositionX[3];
    
GetPlayerPos(playerid, pPositionX[0], pPositionX[1], pPositionX[2]);
    foreach(
Player, i)
    {
        
GetPlayerPos(i, oPositionX[0], oPositionX[1], oPositionX[2]);
        if(
IsPlayerInRangeOfPoint(i, radi / 16, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col1, string); }
        else if(
IsPlayerInRangeOfPoint(i, radi / 8, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col2, string); }
        else if(
IsPlayerInRangeOfPoint(i, radi / 4, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col3, string); }
        else if(
IsPlayerInRangeOfPoint(i, radi / 2, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col4, string); }
        else if(
IsPlayerInRangeOfPoint(i, radi, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col5, string); }
    }
    return 
1;
} 
If this still doesn't work, I'd suggest starting over with the local chat and use this tutorial:
https://sampforum.blast.hk/showthread.php?tid=279575


Re: Number of Arguments does not match definition! - ChromeAmazing - 22.02.2015

Thank you so much! REP'd!