invalid expression, assumed zero
#1

I was scripting a team script and got 1 error at the end.

pawn Код:
#include <a_samp>
#pragma tabsize 0

#define Army 1
#define Terrorist 2

#define ArmyColor 0x0015FFAA
#define TerroristColor 0xFF0000AA

main()

public OnGameModeInit( )
{
        AddPlayerClass(287,2038.5416,1342.3601,10.6719,270.0824,26,900,28,900,38,1000); //TEAM ONE
        AddPlayerClass(108,1831.0970,-1682.6102,13.5469,88.3051,26,900,28,900,38,1000);// TEAM TWO
        return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
         case 0:
         {
              SetPlayerTeam(playerid, Army);
              GameTextForPlayer(playerid, "~b~Army", 1000, 3);
          }

         case 1:
         {
              SetPlayerTeam(playerid, Terrorist);
              GameTextForPlayer(playerid, "~r~Terrorist, 1000", 3);
          }
     }
     return 1;
}

public OnPlayerSpawn(playerid)
{
    switch( GetPlayerTeam( playerid ) )
    {
        case Army:
        {
            SetPlayerColor(playerid, ArmyColor);
        }
        case Terrorist:
        {
            SetPlayerColor(playerid, TerroristColor);
        }
    }
return 1;
}
Reply
#2

Which line is the error on?
Reply
#3

Quote:
Originally Posted by NviDa
Посмотреть сообщение
pawn Код:
main()
That's the error.
Reply
#4

we need i line of the error for help you.. but i can see that the return 1; at onplayerspawn callback is bad indented.
Reply
#5

what EnzoMetlc said " Main() " is the error

here i fixed it

pawn Код:
#include <a_samp>
#pragma tabsize 0

#define Army 1
#define Terrorist 2

#define ArmyColor 0x0015FFAA
#define TerroristColor 0xFF0000AA

main (){}

public OnGameModeInit( )
{
        AddPlayerClass(287,2038.5416,1342.3601,10.6719,270.0824,26,900,28,900,38,1000); //TEAM ONE
        AddPlayerClass(108,1831.0970,-1682.6102,13.5469,88.3051,26,900,28,900,38,1000);// TEAM TWO
        return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
         case 0:
         {
              SetPlayerTeam(playerid, Army);
              GameTextForPlayer(playerid, "~b~Army", 1000, 3);
          }

         case 1:
         {
              SetPlayerTeam(playerid, Terrorist);
              GameTextForPlayer(playerid, "~r~Terrorist, 1000", 3);
          }
     }
     return 1;
}

public OnPlayerSpawn(playerid)
{
    switch( GetPlayerTeam( playerid ) )
    {
        case Army:
        {
            SetPlayerColor(playerid, ArmyColor);
        }
        case Terrorist:
        {
            SetPlayerColor(playerid, TerroristColor);
        }
    }
    return 1;
}
Reply
#6

EnzoMetlc

I fixed the Main ()
But now I am getting this.
E:\Andrew\samp03z_svr_R1_win32\gamemodes\team2.pwn (37) : warning 202: number of arguments does not match definition

@Namer
Yea I corrected that.
but I still get the warning above.
Reply
#7

What is the code on line 37?
Reply
#8

Nothing,on 38 its OnPlayerSpawn,switch etc.
Reply
#9

pawn Код:
case 1:
         {
              SetPlayerTeam(playerid, Terrorist);
              GameTextForPlayer(playerid, "~r~Terrorist, 1000", 3);
          }
you have put " after 1000 delete it.

Solved XD
Reply
#10

Lol!Yea! Thanks.

REP +
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)