SA-MP Forums Archive
3 Errors. - 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: 3 Errors. (/showthread.php?tid=311770)



3 Errors. - JohnDoVaS12345 - 18.01.2012

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys == 16) {
        if(IsInShml[playerid] > 0) {
            new Float:X,Float:Y,Float:Z;
            GetVehiclePos(IsInShml[playerid], X, Y, Z);
            SetPlayerPos(playerid, X+4, Y, Z);
            SetPlayerInterior(playerid, 0);
            IsInShml[playerid]=0;
		}
	}
	return 1;
}
	if (PRESSED(KEY_FIRE))
	{
		if (IsPlayerInAnyVehicle(playerid))
		{
			AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
		}
	}
	return 1;
}
that's were the problem is.
Код:
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\MyGameMode.pwn(4806) : error 010: invalid function or declaration
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\MyGameMode.pwn(4808) : error 010: invalid function or declaration
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\MyGameMode.pwn(4813) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
the errors.


Re: 3 Errors. - sabretur - 18.01.2012

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys == 16) {
        if(IsInShml[playerid] > 0) {
            new Float:X,Float:Y,Float:Z;
            GetVehiclePos(IsInShml[playerid], X, Y, Z);
            SetPlayerPos(playerid, X+4, Y, Z);
            SetPlayerInterior(playerid, 0);
            IsInShml[playerid]=0;
        }
    }
    if (PRESSED(KEY_FIRE))
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
        }
    }
    return 1;
}



Re: 3 Errors. - JohnDoVaS12345 - 18.01.2012

Код:
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\MyGameMode.pwn(4804) : error 017: undefined symbol "PRESSED"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: 3 Errors. - Konstantinos - 18.01.2012

pawn Код:
// Under The Includes
#include < a_samp >
// Rest Of Includes

//---


// PRESSED(keys)
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))



Re: 3 Errors. - sabretur - 18.01.2012

Quote:
Originally Posted by JohnDoVaS12345
Посмотреть сообщение
Код:
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\MyGameMode.pwn(4804) : error 017: undefined symbol "PRESSED"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
At top of your script:

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))



Re: 3 Errors. - JohnDoVaS12345 - 18.01.2012

thanks!