Onplayerstatechange problem
#1

Hello,i've a problem.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
   if(newstate==PLAYER_STATE_PASSENGER) && if(gTeam[playerid] == TEAM_COP) return 1;
   else
   {switch(GetVehicleModel(vehicleid))
   {
   case 497,447,523,416,433,427,490,528,407,544,596,597,598,599,432,601,470,472,430,428;
   {
   new plwl = GetPlayerWantedLevel(playerid);
   plwl = GetPlayerWantedLevel(playerid);
   SetPlayerWantedLevel(playerid,plwl +4);
   new string[128];
   format(string, sizeof(string), "- CRIME - Law Enforcement Vehicle Rob - Wanted Level %d ",plwl);
   SendClientMessage(playerid,red,string);
   }
}
   return 1;
}
When a player enter in a vehicle id listed in "case",it gets +4 Wanted level,but ONLY for TEAM_CIV.

I got this errors when compiling:

Код:
C:\Documents and Settings\Symone\Desktop\Cops&Robbers\gamemodes\SF.pwn(1518) : error 029: invalid expression, assumed zero
C:\Documents and Settings\S\Desktop\Cops&Robbers\gamemodes\SF.pwn(1518) : warning 215: expression has no effect
C:\Documents and Settings\S\Desktop\Cops&Robbers\gamemodes\SF.pwn(1518) : error 001: expected token: ";", but found "if"
C:\Documents and Settings\S\Desktop\Cops&Robbers\gamemodes\SF.pwn(1520) : error 017: undefined symbol "vehicleid"
C:\Documents and Settings\S\Desktop\Cops&Robbers\gamemodes\SF.pwn(1522) : error 001: expected token: ":", but found ";"
C:\Documents and Settings\S\Desktop\Cops&Robbers\gamemodes\SF.pwn(1522) : error 036: empty statement
C:\Documents and Settings\S\Desktop\Cops&Robbers\gamemodes\SF.pwn(1531) : warning 209: function "OnPlayerStateChange" should return a value
C:\Documents and Settings\S\Desktop\Cops&Robbers\gamemodes\SF.pwn(1532) : error 010: invalid function or declaration

6 Errors.
What's wrong?Thanks.
Reply


Messages In This Thread
Onplayerstatechange problem - by Face9000 - 26.01.2012, 22:33
Re: Onplayerstatechange problem - by MP2 - 26.01.2012, 22:38
Re: Onplayerstatechange problem - by Face9000 - 26.01.2012, 22:42
Re: Onplayerstatechange problem - by MP2 - 26.01.2012, 22:50
Re: Onplayerstatechange problem - by Face9000 - 26.01.2012, 23:07
Re: Onplayerstatechange problem - by [ABK]Antonio - 26.01.2012, 23:10
Re: Onplayerstatechange problem - by Face9000 - 26.01.2012, 23:12
Re: Onplayerstatechange problem - by [ABK]Antonio - 26.01.2012, 23:14
Re: Onplayerstatechange problem - by Face9000 - 26.01.2012, 23:30
Re: Onplayerstatechange problem - by Face9000 - 27.01.2012, 09:14

Forum Jump:


Users browsing this thread: 2 Guest(s)