SA-MP Forums Archive
An odd warning - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: An odd warning (/showthread.php?tid=267958)



An odd warning - HayZatic - 10.07.2011

Код:
C:\Documents and Settings\Chris\Desktop\SAMP Server\gamemodes\WorldWar.pwn(286) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Chris\Desktop\SAMP Server\gamemodes\WorldWar.pwn(294) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    if(GetPlayerTeam(killerid) == 1)
    {
        RussiaScore++; //Sets team1score
        new newtext[41];
        GetPlayerScore(playerid, RussiaScore);//this code gives warning
        format(newtext, sizeof(newtext), "BLUE: %d", RussiaScore);
        TextDrawSetString(Text:Textdraw0, newtext);
    }
    if(GetPlayerTeam(killerid) == 2)
    {
        USAScore++; //Sets team2score
        new newtext[41];
        GetPlayerScore(playerid, USAScore);// This code produces warning
        format(newtext, sizeof(newtext), "Red: %d", USAScore);
        TextDrawSetString(Text:Textdraw1, newtext);
    }
    if(RussiaScore == 100 || USAScore == 100)
    {
        SendRconCommand("gmx"); //Restarts Server
    }
    return 1;
}



Re: An odd warning - jameskmonger - 10.07.2011

What are lines 286 and 294?


Re: An odd warning - Mikkel_Pedersen - 10.07.2011

https://sampwiki.blast.hk/wiki/GetPlayerScore

GetPlayerScore returns the score.
So you would do:
pawn Код:
RussiaScore = GetPlayerScore(playerid);
USAScore = GetPlayerScore(playerid);

EDIT: Of what I could see, it seems quite useless to first do "Russia/USAScore++" and then setting its value to the killed player's score.


Re: An odd warning - HayZatic - 10.07.2011

Quote:
Originally Posted by Mikkel_Pedersen
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/GetPlayerScore

GetPlayerScore returns the score.
So you would do:
pawn Код:
RussiaScore = GetPlayerScore(playerid);
USAScore = GetPlayerScore(playerid);

EDIT: Of what I could see, it seems quite useless to first do "Russia/USAScore++" and then setting its value to the killed player's score.
Big help, Thanks bud


Re: An odd warning - HayZatic - 10.07.2011



Did i do something wrong?