SA-MP Forums Archive
Warning.. help me in this please - 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.. help me in this please (/showthread.php?tid=610280)



Warning.. help me in this please - Krauser123 - 22.06.2016

I'm just getting this warning and i don't know why it's coming..

Код:
C:\Users\Krauser\Desktop\New folder (4)\filterscripts\tokens.pwn(78) : warning 202: number of arguments does not match definition
C:\Users\Krauser\Desktop\New folder (4)\filterscripts\tokens.pwn(78) : warning 202: number of arguments does not match definition
C:\Users\Krauser\Desktop\New folder (4)\filterscripts\tokens.pwn(80) : warning 202: number of arguments does not match definition
C:\Users\Krauser\Desktop\New folder (4)\filterscripts\tokens.pwn(80) : warning 202: number of arguments does not match definition
PHP код:
if(PlayerInfo[playerid][ptokens] >= amount)
        {
            
PlayerInfo[TarID][ptokens] += amount;
            
PlayerInfo[playerid][ptokens] -= amount;
            
format(stringsizeof(string), "You have recieved %d Tokens from %s."amountGetPlayerName(playerid));
            
SendClientMessage(TarIDCOLOR_GRAD2string);
            
format(stringsizeof(string), "You have given %s %d Tokens."GetPlayerName(TarID), amount);
            
SendClientMessage(playeridCOLOR_GRAD2string);
        } 
Line 78 and Line 80

PHP код:
    78        format(stringsizeof(string), "You have recieved %d Tokens from %s."amountGetPlayerName(playerid));
    
79        SendClientMessage(TarIDCOLOR_GRAD2string);
    
80        format(stringsizeof(string), "You have given %s %d Tokens."GetPlayerName(TarID), amount);
    
81        SendClientMessage(playeridCOLOR_GRAD2string); 



Re: Warning.. help me in this please - [XST]O_x - 22.06.2016

Check your GetPlayerName function


Re: Warning.. help me in this please - Krauser123 - 22.06.2016

Explain please i'm new at scripting


Re: Warning.. help me in this please - sKJaoSAMP - 22.06.2016

Open your gamemode, and search for

GetPlayerName(playerid, name, sizeof(name));


Re: Warning.. help me in this please - Krauser123 - 22.06.2016

Can't Find it


Re: Warning.. help me in this please - sKJaoSAMP - 22.06.2016

Try This.


Код:
if(PlayerInfo[playerid][ptokens] >= amount) 
        {
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            PlayerInfo[TarID][ptokens] += amount; 
            PlayerInfo[playerid][ptokens] -= amount; 
            format(string, sizeof(string), "You have recieved %d Tokens from %s.", amount, GetPlayerName(playerid)); 
            SendClientMessage(TarID, COLOR_GRAD2, string); 
            format(string, sizeof(string), "You have given %s %d Tokens.", GetPlayerName(TarID), amount); 
            SendClientMessage(playerid, COLOR_GRAD2, string); 
        }



Re: Warning.. help me in this please - oMa37 - 22.06.2016

Why don't make something easier?

Add this somewhere in your script:
PHP код:
GetName(playerid)
{
    new 
pName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
    return 
pName;

And your code:
PHP код:
if(PlayerInfo[playerid][ptokens] >= amount

    
PlayerInfo[TarID][ptokens] += amount
    
PlayerInfo[playerid][ptokens] -= amount
    
format(stringsizeof(string), "You have recieved %d Tokens from %s."amountGetName(playerid)); 
    
SendClientMessage(TarIDCOLOR_GRAD2string); 
    
format(stringsizeof(string), "You have given %s %d Tokens."GetName(TarID), amount); 
    
SendClientMessage(playeridCOLOR_GRAD2string); 




Re: Warning.. help me in this please - Krauser123 - 22.06.2016

Solved Thanks everyone


Re: Warning.. help me in this please - sKJaoSAMP - 22.06.2016

Quote:
Originally Posted by Krauser123
Посмотреть сообщение
Solved Thanks everyone
It's nothing!