SA-MP Forums Archive
Need help with my function please. - 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: Need help with my function please. (/showthread.php?tid=658855)



Need help with my function please. - SaMuRy - 14.09.2018

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

Thank you guys


Re: Need help with my function please. - AmirSavand - 14.09.2018

Show the code form line 17976 in your gamemode.


Re: Need help with my function please. - Undef1ned - 14.09.2018

PHP код:
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;




Re: Need help with my function please. - AmirSavand - 15.09.2018

Quote:
Originally Posted by Undef1ned
Посмотреть сообщение
PHP код:
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.


Re: Need help with my function please. - Undef1ned - 15.09.2018

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


Re: Need help with my function please. - AmirSavand - 15.09.2018

Quote:
Originally Posted by Undef1ned
Посмотреть сообщение
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
Посмотреть сообщение
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
Посмотреть сообщение
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 "}".


Re: Need help with my function please. - Banditul18 - 15.09.2018

Quote:
Originally Posted by AmirSavand
Посмотреть сообщение
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()


Re: Need help with my function please. - UFF - 15.09.2018

Quote:
Originally Posted by AmirSavand
Посмотреть сообщение
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
Код:
#define function%0(%1) forward %0(%1); public %0(%1)
To find the missing brackets, you can use this tool.
https://sampforum.blast.hk/showthread.php?tid=291018


Re: Need help with my function please. - AmirSavand - 15.09.2018

Quote:
Originally Posted by UFF
Посмотреть сообщение
function can be defined as
Код:
#define function%0(%1) forward %0(%1); public %0(%1)
To find the missing brackets, you can use this tool.
https://sampforum.blast.hk/showthread.php?tid=291018
I know how they can be defined.

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


Re: Need help with my function please. - Undef1ned - 15.09.2018

Quote:
Originally Posted by AmirSavand
Посмотреть сообщение
I know how they can be defined.

@SaMuRy use the tool he shared and see if you can fix your issue.
So, why the hell are you saying we're not in javascript?

LMAO