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



Compile Error [SOLVED] - AfiqIqbal - 19.06.2017

When I compile my script, this came out. I already checked the line, but there was no 254 / 267 line. How can I fix this?

Quote:

C:\Program Files\Pawno\include\YSI\..\YSI_Data\..\YSI_Interna l\..\YSI_Core\y_utils.inc(254) : warning 202: number of arguments does not match definition
C:\Program Files\Pawno\include\YSI\..\YSI_Data\..\YSI_Interna l\..\YSI_Core\y_utils.inc(267) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.




Re: Compile Error - Whatname - 19.06.2017

the error is not in your script its in the include


Re: Compile Error - AfiqIqbal - 19.06.2017

I've updated my YSI to version 4.0, and it still gives me the same error.


Re: Compile Error - JasonRiggs - 19.06.2017

This means that you are miss-using the function, As it is defined in a way in the include and you are using it in a different way in the script, Post the lines here..


Re: Compile Error - AfiqIqbal - 19.06.2017

I don't know which code was related to y_utils.inc since I did not include ysi in this filterscript. So, I will post the code that use an include to run.

Top of script :

PHP код:
new bool:IsVotekickStarted;
new 
bool:HasPlayerVoted[MAX_PLAYERS];
new 
vktargetid = -1vkreasonvkplayername[MAX_PLAYER_NAME], vktargetname[MAX_PLAYER_NAME], vkyesvkno
Code :

PHP код:
CMD:votekick(playeridparams[])
{
    if(
sscanf(params"us[128]"vktargetidvkreason))
    {
        return 
SendClientMessage(playerid, -1"[Error:] /votekick <id> <reason>");
    }
    if(
IsVotekickStarted == true)
    {
        return 
SendClientMessage(playerid, -1,"[Error:] {BBBBBB}A votekick has been already started. Wait until it finish to ask for a new one");
    }
    if(
vktargetid == -1)
    {
        return 
SendClientMessage(playerid, -1"[Error:] Player is not connected!");
    }
    new 
string[128];
    
vktargetid playerid;
    
GetPlayerName(playeridvkplayernamesizeof(vkplayername));
    
GetPlayerName(vktargetidvktargetnamesizeof(vktargetname));
    
format(stringsizeof(string), "{C14124}%s{BBBBBB} has started a votekick for {C14124}%s{BBBBBB} reason: %s. Type {60B149}Yes{BBBBBB} or {B35349}No{BBBBBB} to vote."vkplayernamevktargetnamevkreason);
    
SendClientMessageToAll(-1string);
    
IsVotekickStarted true;
    foreach(new 
Player)
    {
        
HasPlayerVoted[i] = false;
    }
    
SetTimer("VotekickTimer"60000false);
    return 
1;

Maybe this?

PHP код:
forward KickTimer();
public 
KickTimer()
{
    
Kick(vktargetid);
    return 
1;
}
forward VotekickTimer();
public 
VotekickTimer()
{
    
GetPlayerName(vktargetidvktargetnamesizeof(vktargetname));
    if(
vkyes vkno)
    {
        new 
string[128];
        
format(stringsizeof(string), "{C14124}%s {BBBBBB}has been votekicked reason: %s. [%d Yes | %d No]"vktargetnamevkreasonvkyesvkno);
        
SendClientMessageToAll(-1string);
        
SetTimer("KickTimer"1000false);
    }
    else
    {
        new 
string[128];
        
format(stringsizeof(string), "{C14124}%s {BBBBBB}has not been kicked. [%d Yes | %d No]"vktargetnamevkyesvkno);
        
SendClientMessageToAll(-1string);
    }
    
vkyes 0vkno 0vktargetid = -1IsVotekickStarted false;
    return 
1;




Re: Compile Error - JasonRiggs - 20.06.2017

As far as I'm concerned that the include u got has a problem, As the function which got a problem is defined as a thing in the script or another include, and its defined in a different way in that include y_utils..


Re: Compile Error - AfiqIqbal - 20.06.2017

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
As far as I'm concerned that the include u got has a problem, As the function which got a problem is defined as a thing in the script or another include, and its defined in a different way in that include y_utils..
What is the use of y_utils?


Re: Compile Error - AfiqIqbal - 21.06.2017

BUMP


Re: Compile Error - JasonRiggs - 21.06.2017

Whenever you include something which is related to YSI all the includes of YSI are being used, that's why you need to update all the YSI includes to the latest, Get them from ******..


Re: Compile Error - Konstantinos - 21.06.2017

I looked at the YSI file and it's the OnPlayerDisconnect hook. Do you by any chance have this in your script?
pawn Код:
public OnPlayerDisconnect(playerid)
This callback must have the second parameter as well:
pawn Код:
public OnPlayerDisconnect(playerid, reason)