SA-MP Forums Archive
OnPlayerWeaponShot Error... - 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: OnPlayerWeaponShot Error... (/showthread.php?tid=529658)



OnPlayerWeaponShot Error... - kesarthakur - 03.08.2014

+rep for help


this are the errors i am getting :

Код:
C:\Documents and Settings\Admin\Desktop\gamemodes\usf.pwn(3048) : warning 235: public function lacks forward declaration (symbol "OnPlayerWeaponShot")
C:\Documents and Settings\Admin\Desktop\gamemodes\usf.pwn(3054) : error 017: undefined symbol "GetPlayerLastShotVectors"
C:\Documents and Settings\Admin\Desktop\gamemodes\usf.pwn(3053) : warning 203: symbol is never used: "fOriginZ"
C:\Documents and Settings\Admin\Desktop\gamemodes\usf.pwn(3053) : warning 203: symbol is never used: "fOriginY"
C:\Documents and Settings\Admin\Desktop\gamemodes\usf.pwn(3053) : warning 203: symbol is never used: "fOriginX"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
with the code:

pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(!IsPlayerConnected(playerid)) return 0;
    if(weaponid == 33)
    {
    new Float:fOriginX, Float:fOriginY, Float:fOriginZ, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ;
    GetPlayerLastShotVectors(playerid, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ);
    CreateExplosion(fHitPosX, fHitPosY, fHitPosZ, 12, 1);
    }
    return 1;
}

please help me

thanks in advance



Re: OnPlayerWeaponShot Error... - McBan - 03.08.2014

PHP код:
forward OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ);
public 
OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    if(!
IsPlayerConnected(playerid)) return 0;
    if(
weaponid == 33)
    {
    new 
Float:bOriginXFloat:bOriginYFloat:bOriginZFloat:bHitPosXFloat:bHitPosYFloat:bHitPosZ;
    
GetPlayerLastShotVectors(playerid,  Float:bOriginXFloat:bOriginYFloat:bOriginZFloat:bHitPosXFloat:bHitPosYFloat:bHitPosZ);
    
CreateExplosion(fHitPosXfHitPosYfHitPosZ121);
    }
    return 
1;




Re: OnPlayerWeaponShot Error... - Threshold - 03.08.2014

No McBan... it doesn't work like that...

'OnPlayerWeaponShot' and 'GetPlayerLastShotVectors' were both added in SA-MP 0.3z, this just means that you have an outdated/old a_samp include. You can download the latest SA-MP package at http://www.sa-mp.com/download


Re: OnPlayerWeaponShot Error... - kesarthakur - 03.08.2014

Quote:
Originally Posted by Threshold
Посмотреть сообщение
No McBan... it doesn't work like that...

'OnPlayerWeaponShot' and 'GetPlayerLastShotVectors' were both added in SA-MP 0.3z, this just means that you have an outdated/old a_samp include. You can download the latest SA-MP package at http://www.sa-mp.com/download
thank you

+repped