SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/09/2018, 11:02 AM   #1
SaMuRy
Little Clucker
 
Join Date: Sep 2018
Posts: 11
Reputation: 0
Default Need help with my function please.

https://pastebin.com/BMSqpYCD - Get in --- PB
The help request is explained there.

Thank you guys
SaMuRy is offline   Reply With Quote
Old 14/09/2018, 01:06 PM   #2
AmirSavand
Big Clucker
 
AmirSavand's Avatar
 
Join Date: Sep 2018
Location: Behind Schedule
Posts: 52
Reputation: 1
Default Re: Need help with my function please.

Show the code form line 17976 in your gamemode.
__________________

GitHub - Website - Contact

C# - Python - PHP - Angular
Unity 3D - Django - Electron

AmirSavand is offline   Reply With Quote
Old 14/09/2018, 03:16 PM   #3
Undef1ned
Big Clucker
 
Join Date: Aug 2018
Location: Venezuela
Posts: 105
Reputation: 12
Default Re: Need help with my function please.

PHP Code:
function PWarHighCheck(playerid)
{
    new 
Float:pos[3];
    
GetPlayerPos(playeridpos[0], pos[1], pos[2]);
    
    if(
pos[2] < 46.1413 && PWarBattle[playerid][InPWar])
    {
        
PLozzerPWar(playerid);
        return 
1;
    }
    
    if(
PWarBattle[playerid][InPWar]) SetTimerEx("PWarHighCheck"1000false"d"playerid);
    return 
1;

Undef1ned is offline   Reply With Quote
Old 15/09/2018, 01:24 AM   #4
AmirSavand
Big Clucker
 
AmirSavand's Avatar
 
Join Date: Sep 2018
Location: Behind Schedule
Posts: 52
Reputation: 1
Default Re: Need help with my function please.

Quote:
Originally Posted by Undef1ned View Post
PHP Code:
function PWarHighCheck(playerid)
{
    new 
Float:pos[3];
    
GetPlayerPos(playeridpos[0], pos[1], pos[2]);
    
    if(
pos[2] < 46.1413 && PWarBattle[playerid][InPWar])
    {
        
PLozzerPWar(playerid);
        return 
1;
    }
    
    if(
PWarBattle[playerid][InPWar]) SetTimerEx("PWarHighCheck"1000false"d"playerid);
    return 
1;

You should write stock instead of function, this is not JavaScript.

Anyway we talked in private chat and the issue is not that simple, it's almost impossible to be solved by someone else.
__________________

GitHub - Website - Contact

C# - Python - PHP - Angular
Unity 3D - Django - Electron

AmirSavand is offline   Reply With Quote
Old 15/09/2018, 02:26 AM   #5
Undef1ned
Big Clucker
 
Join Date: Aug 2018
Location: Venezuela
Posts: 105
Reputation: 12
Default Re: Need help with my function please.

What do you mean by saying that this is not "JavaScript", do you know how to define "function" or at least some time in your life have you used it? If you think you can not solve a problem or at least look for a solution, then this not for you. I do not see anything complicated in that code
Undef1ned is offline   Reply With Quote
Old 15/09/2018, 07:05 AM   #6
AmirSavand
Big Clucker
 
AmirSavand's Avatar
 
Join Date: Sep 2018
Location: Behind Schedule
Posts: 52
Reputation: 1
Default Re: Need help with my function please.

Quote:
Originally Posted by Undef1ned View Post
What do you mean by saying that this is not "JavaScript"[/COLOR][/SIZE]
You do not declare functions in pawn via function keyword!

Quote:
Originally Posted by Undef1ned View Post
do you know how to define "function" or at least some time in your life have you used it?[/COLOR][/SIZE]
What the hell are you talking about.

Quote:
Originally Posted by Undef1ned View Post
If you think you can not solve a problem or at least look for a solution, then this not for you.[/COLOR][/SIZE]
We did discuss the issue and I did try to solve it but the error line in the gamemode I received had no issue and the indention was horrible, there could be a missing "{" or "}".
__________________

GitHub - Website - Contact

C# - Python - PHP - Angular
Unity 3D - Django - Electron

AmirSavand is offline   Reply With Quote
Old 15/09/2018, 07:15 AM   #7
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 318
Reputation: 25
Default Re: Need help with my function please.

Quote:
Originally Posted by AmirSavand View Post
You do not declare functions in pawn via function keyword!
Actually people are lazy, the function keyword in this case its a macro which foward a function and make it public

Its like writeing
foward Example();
public Example()
But you just write
function Example()
__________________
Banditul18 is offline   Reply With Quote
Old 15/09/2018, 07:49 AM   #8
AmirSavand
Big Clucker
 
AmirSavand's Avatar
 
Join Date: Sep 2018
Location: Behind Schedule
Posts: 52
Reputation: 1
Default Re: Need help with my function please.

Quote:
Originally Posted by Banditul18 View Post
Actually people are lazy, the function keyword in this case its a macro which foward a function and make it public

Its like writeing
foward Example();
public Example()
But you just write
function Example()
I see, anyway like I said, the function has no issues it compiles fine. The error is somewhere else buried deep in ugly code.
__________________

GitHub - Website - Contact

C# - Python - PHP - Angular
Unity 3D - Django - Electron

AmirSavand is offline   Reply With Quote
Old 15/09/2018, 09:02 AM   #9
UFF
Huge Clucker
 
UFF's Avatar
 
Join Date: Feb 2018
Location: Funky World
Posts: 276
Reputation: 26
Default Re: Need help with my function please.

Quote:
Originally Posted by AmirSavand View Post
You should write stock instead of function, this is not JavaScript.

Anyway we talked in private chat and the issue is not that simple, it's almost impossible to be solved by someone else.
function can be defined as
Code:
#define function%0(%1) forward %0(%1); public %0(%1)
To find the missing brackets, you can use this tool.
http://forum.sa-mp.com/showthread.php?t=291018
__________________
(¯`·._.·Ultimate Funky Freeroam._.·´¯)



UFF is online now   Reply With Quote
Old 15/09/2018, 09:07 AM   #10
AmirSavand
Big Clucker
 
AmirSavand's Avatar
 
Join Date: Sep 2018
Location: Behind Schedule
Posts: 52
Reputation: 1
Default Re: Need help with my function please.

Quote:
Originally Posted by UFF View Post
function can be defined as
Code:
#define function%0(%1) forward %0(%1); public %0(%1)
To find the missing brackets, you can use this tool.
http://forum.sa-mp.com/showthread.php?t=291018
I know how they can be defined.

@SaMuRy use the tool he shared and see if you can fix your issue.
__________________

GitHub - Website - Contact

C# - Python - PHP - Angular
Unity 3D - Django - Electron

AmirSavand is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 055: start of function body without function header FreddiewJO Scripting Help 3 24/06/2015 10:14 PM
[Ajuda] error 055: start of function body without function header AndersonAq Português/Portuguese 3 14/03/2014 12:31 AM
Returning inside a switch case, does it go back to the scope of the function, or does it return for the function? Hoborific Scripting Help 4 26/06/2013 12:47 PM
Is using plugin function better than Pawn function?(process same things) yxliang Plugin Development 3 29/12/2012 02:50 PM


All times are GMT. The time now is 06:05 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.