SA-MP Forums Archive
OnPlayerWeaponshot - 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 (/showthread.php?tid=623748)



OnPlayerWeaponshot - Rassh - 04.12.2016

This is the script
Код:
public OnPlayerWeaponShot(playerid, 31, 1, hitid, 0.0, 0.0, 0.0)
{
    new szString[144];
    format(szString, sizeof(szString), "Weapon %i fired. hittype: %i   hitid: %i   pos: %f, %f, %f", 31, 1, hitid, 0.0, 0.0, 0.0);
    return 1;
}
This is the error I get, line 8 is the public...
C:\Users\Astro\Desktop\Server1\gamemodes\hi.pwn( : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

could anyone fix it for me?


Re: OnPlayerWeaponshot - AnthonyDaBestt - 04.12.2016

PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    new 
szString[144];
    
format(szStringsizeof(szString), "Weapon %i fired. hittype: %i   hitid: %i   pos: %f, %f, %f"weaponidhittypehitidfXfYfZ);
    
SendClientMessage(playerid, -1szString);
 
    return 
1;

try this.


Re: OnPlayerWeaponshot - Rassh - 04.12.2016

Quote:
Originally Posted by AnthonyDaBestt
Посмотреть сообщение
PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    new 
szString[144];
    
format(szStringsizeof(szString), "Weapon %i fired. hittype: %i   hitid: %i   pos: %f, %f, %f"weaponidhittypehitidfXfYfZ);
    
SendClientMessage(playerid, -1szString);
 
    return 
1;

try this.
That's the format from wiki, but when I put the weaponid, playerid, hittype I get the errors.


Re: OnPlayerWeaponshot - itsCody - 04.12.2016

public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)

that's the correct format..

post the errors