SA-MP Forums Archive
error 001: expected token: "(", but found ";" ??? - 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: error 001: expected token: "(", but found ";" ??? (/showthread.php?tid=548924)



error 001: expected token: "(", but found ";" ??? - quochuy7915 - 03.12.2014

How to fix Erro Pawno
bullethole.pwn(97) : error 001: expected token: "(", but found ";"
bullethole.pwn(98 ) : error 001: expected token: ")", but found "public"
bullethole.pwn(98 ) : error 001: expected token: ";", but found "public"
Код:
forward OnPlayerWeaponShot;
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
??
Help me


Re: error 001: expected token: "(", but found ";" ??? - Glossy42O - 03.12.2014

forward OnPlayerWeaponShot(playerid);

If it doesn't work try, forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);


Re: error 001: expected token: "(", but found ";" ??? - quochuy7915 - 03.12.2014

Quote:
Originally Posted by Stuun
Посмотреть сообщение
forward OnPlayerWeaponShot(playerid);

If it doesn't work try, forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
bullethole.pwn(98 ) : error 025: function heading differs from prototype
Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
How to fix


Re: error 001: expected token: "(", but found ";" ??? - Glossy42O - 03.12.2014

Try to remove playerid,


Re: error 001: expected token: "(", but found ";" ??? - quochuy7915 - 03.12.2014

Quote:
Originally Posted by Stuun
Посмотреть сообщение
Try to remove playerid,
it Doesn't work !
Before remove playerid in public OnPlayerWeaponShot

bullethole.pwn(98 ) : error 025: function heading differs from prototype
bullethole.pwn(105) : error 017: undefined symbol "playerid"
bullethole.pwn(106) : error 017: undefined symbol "playerid"



Re: error 001: expected token: "(", but found ";" ??? - Glossy42O - 03.12.2014

wait wait, add it lol i was wrong.

Post the whole code inside that callback


Re: error 001: expected token: "(", but found ";" ??? - quochuy7915 - 03.12.2014

Quote:
Originally Posted by Stuun
Посмотреть сообщение
wait wait, add it lol i was wrong.

Post the whole code inside that callback
This is my code

Код:
forward OnPlayerWeaponShot(playerid);
public OnPlayerWeaponShot(weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
        if(weaponid == 38 || weaponid == 37 || weaponid == 36 || weaponid == 35) return 1;
    else{
            if(hittype == 0 && fX != 0)
            {
                new Float: A, Float: rX, Float: rY;
                GetXYInFrontOfPlayer(playerid, rX, rY, 5.0);
                GetPlayerFacingAngle(playerid, A);
                        CreateHole(fX, fY, fZ, rX, rY, A-90);
                }
        }
        return 1;
}



Re: error 001: expected token: "(", but found ";" ??? - Larceny - 03.12.2014

Remove forward OnPlayerWeaponShot(playerid); and be sure you are using 0.3z+ includes.


Re: error 001: expected token: "(", but found ";" ??? - quochuy7915 - 03.12.2014

Quote:
Originally Posted by Larceny
Посмотреть сообщение
Remove forward OnPlayerWeaponShot(playerid); and be sure you are using 0.3z+ includes.
OK this work
Tks for rep+