Errors
#1

Код:
C:\Documents and Settings\Sebastian\Desktop\usercp.pwn(218) : error 017: undefined symbol "oldstate"
C:\Documents and Settings\Sebastian\Desktop\usercp.pwn(220) : error 017: undefined symbol "newstate"
C:\Documents and Settings\Sebastian\Desktop\usercp.pwn(228) : error 017: undefined symbol "oldstate"
C:\Documents and Settings\Sebastian\Desktop\usercp.pwn(230) : error 017: undefined symbol "newstate"
C:\Documents and Settings\Sebastian\Desktop\usercp.pwn(238) : error 017: undefined symbol "oldstate"
C:\Documents and Settings\Sebastian\Desktop\usercp.pwn(240) : error 017: undefined symbol "newstate"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
220
Код:
if(newstate == PLAYER_STATE_ONFOOT)
228
Код:
if(oldstate == PLAYER_STATE_PASSENGER)
230
Код:
if(newstate == PLAYER_STATE_ONFOOT)
238
Код:
if(oldstate == PLAYER_STATE_ONFOOT)
240
Код:
if(newstate == PLAYER_STATE_DRIVER || PLAYER_STATE_PASSENGER)
Pls HELP !
Reply
#2

Firstly;
Код:
if(newstate == PLAYER_STATE_DRIVER || PLAYER_STATE_PASSENGER)
should be
Код:
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
Secondly, you do have this under OnPlayerStateChange callback, don't you?
Reply
#3

Yes...this are the lines were i get that errors
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(Act[playerid] == 1)
        {
                if(oldstate == PLAYER_STATE_DRIVER)
                {
                        if(newstate == PLAYER_STATE_ONFOOT)
                        {
                                if(InCar[playerid] == 1)
                                {
                                        PutPlayerInVehicle(playerid, WhatCar[playerid], Driver);
                                }
                        }
                }
                if(oldstate == PLAYER_STATE_PASSENGER)
                {
                        if(newstate == PLAYER_STATE_ONFOOT)
                        {
                                if(InCar[playerid] == 1)
                                {
                                        PutPlayerInVehicle(playerid, WhatCar[playerid], Passanger);
                                }
                        }
                }
                if(oldstate == PLAYER_STATE_ONFOOT)
                {
                        if(newstate == PLAYER_STATE_DRIVER || PLAYER_STATE_PASSENGER)
                        {
                                InCar[playerid] = 1;
                                WhatCar[playerid] = GetPlayerVehicleID(playerid);
                        }
                }
        }
Reply
#4

OnPlayerStateChange and OnPlayerKeyStateChange are two different callbacks.

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(Act[playerid] == 1)
	{
		if(oldstate == PLAYER_STATE_DRIVER)
		{
			if(newstate == PLAYER_STATE_ONFOOT)
			{
				if(InCar[playerid] == 1) PutPlayerInVehicle(playerid, WhatCar[playerid], Driver);
			}
		}
		if(oldstate == PLAYER_STATE_PASSENGER)
		{
			if(newstate == PLAYER_STATE_ONFOOT)
			{
				if(InCar[playerid] == 1) PutPlayerInVehicle(playerid, WhatCar[playerid], Passanger);
			}
		}
		if(oldstate == PLAYER_STATE_ONFOOT)
		{
			if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
			{
				InCar[playerid] = 1;
				WhatCar[playerid] = GetPlayerVehicleID(playerid);
			}
		}
	}
	return 1;
}
Reply
#5

Thx man ! it works !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)