SA-MP Forums Archive
Help [+1 rep] - 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: Help [+1 rep] (/showthread.php?tid=322883)



Help [+1 rep] - sniperwars - 03.03.2012

Hi,

I'm currently helping my friend with his script and he has 2 teams:

pawn Код:
#define TEAM_AMERICA 0
#define TEAM_CANADA 1
This is the public OnPlayerRequestClass:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
     SetPlayerToTeamColor(playerid);
     SetPlayerTeamFromClass(playerid, classid);
     SetPlayerPos(playerid, 410.7943,2533.8386.,19.1484);
     SetPlayerFacingAngle(playerid, 269.6420);
     SetPlayerCameraPos(playerid, 1387.2906,-1752.8887,13.3828);
     SetPlayerCameraLookAt(playerid, 410.7943,2533.8386,19.1484);

     if(classid == 0)
     {
         GameTextForPlayer(playerid,"~r~ AMERICA",6000,4);
         gTeam[playerid] = TEAM_AMERICA;
     }
     else if(classid == 1)
     {
         GameTextForPlayer(playerid,"~r~ CANADA",6000,4);
         gTeam[playerid] = TEAM_CANADA;
     }
     return 1;
}
This is the SetPlayerToTeamColor:

pawn Код:
forward SetPlayerToTeamColor(playerid);
public SetPlayerToTeamColor(playerid)
{
     SetPlayerToTeamColor(playerid);
     }
     if(gTeam[playerid] == TEAM_AMERICA)
     {
     SetPlayerColor(playerid, TEAM_AMERICA_COLOR);
     }
     else (gTeam[playerid] == TEAM_CANADA)
     {
     SetPlayerColor(playerid, TEAM_CANADA_COLOR);
     }
}
This is the SetPlayerTeamFromClass:

pawn Код:
forward SetPlayerTeamFromClass(playerid, classid);
public SetPlayerTeamFromClass(playerid, classid)
{
     if(classid == 0)
     {
         gTeam[playerid] == TEAM_AMERICA;
     }
     else if(classid == 1)
     {
         gTeam[playerid] ==  TEAM_CANADA;
     }
}
Here is the warning I get with this command:

Код:
warning 202: number of arguments does not match definition
Command:

pawn Код:
CMD:help(playerid,params[])
{
       ShowPlayerDialog(playerid,215,DIALOG_STYLE_MSGBOX,"The server is not yet ready","Close","");
       return 1;
}
Can anyone help me out with this ? He needs it like now.


Re: Help [+1 rep] - aco_SRBIJA - 03.03.2012

show us line (one in bracket while getting error), so we can see where you mistaken.


Re: Help [+1 rep] - sniperwars - 03.03.2012

That's all the errors there.


Re: Help [+1 rep] - ArmyOps - 03.03.2012

C:\Documents and Settings\user\Desktop\samp03bsvr_R2_win32\pawno\sf pd.pwn(114) : warning 202: number of arguments does not match definition

We need ur line, ex: C:\...\gamemodes\XXX.pwn(114) warning on line 114


Re: Help [+1 rep] - aco_SRBIJA - 03.03.2012

just warning? no a locations such a

Код:
C:\Documents and Settings\user\Desktop\samp03bsvr_R2_win32\pawno\sf pd.pwn(114) : warning 202: number of arguments does not match definition
?

I want from you to show me line, in this example, 114.


Re: Help [+1 rep] - sniperwars - 03.03.2012

This is it:

Код:
C:\SAMPServer\pawno\new.pwn(107) : error 010: invalid function or declaration
C:\SAMPServer\pawno\new.pwn(111) : error 010: invalid function or declaration
C:\SAMPServer\pawno\new.pwn(266) : warning 202: number of arguments does not match definition
This is line 266:

pawn Код:
ShowPlayerDialog(playerid,215,DIALOG_STYLE_MSGBOX,"The server is not yet ready","Close","");



Re: Help [+1 rep] - aco_SRBIJA - 03.03.2012

playerid, dialogid, style, caption[], info[], button1[], button2[])

U missed caption. It's a header.


Re: Help [+1 rep] - ArmyOps - 03.03.2012

looks like this:
pawn Код:
ShowPlayerDialog(playerid,215,DIALOG_STYLE_MSGBOX,"Ur Header","The server is not yet ready","Close","");



Re: Help [+1 rep] - sniperwars - 03.03.2012

I've corrected the dialog problem now.
It's the other two errors I have:

Код:
C:\SAMPServer\pawno\new.pwn(107) : error 010: invalid function or declaration
C:\SAMPServer\pawno\new.pwn(111) : error 010: invalid function or declaration
Which is this:

pawn Код:
forward SetPlayerToTeamColor(playerid);
public SetPlayerToTeamColor(playerid)
{
     SetPlayerToTeamColor(playerid);
     }
     if(gTeam[playerid] == TEAM_AMERICA)
     {
     SetPlayerColor(playerid, TEAM_AMERICA_COLOR);
     }
     else (gTeam[playerid] == TEAM_CANADA)
     {
     SetPlayerColor(playerid, TEAM_CANADA_COLOR);
     }
}



Re: Help [+1 rep] - Nuke547 - 03.03.2012

Try this

pawn Код:
forward SetPlayerToTeamColor(playerid);
public SetPlayerToTeamColor(playerid)
{
     if(gTeam[playerid] == TEAM_AMERICA)
     {
        SetPlayerColor(playerid, TEAM_AMERICA_COLOR);
     }
     else (gTeam[playerid] == TEAM_CANADA)
     {
        SetPlayerColor(playerid, TEAM_CANADA_COLOR);
     }
}