SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 15/12/2019, 10:50 AM   #1
AfiqIqbal
Big Clucker
 
AfiqIqbal's Avatar
 
Join Date: Feb 2016
Location: Pahang, Malaysia
Posts: 71
Reputation: 0
Exclamation weapon-config problem

I'm using weapon-config inc, yes I have the SKY plugin already, and I already define it in my gamemode. But everytime I compile the script it shows up 2 errors, the error didn't even show up before i use the include/plugin, it only show up after i use the plugin in my script, I've tried to change the #include position of the SKY and weapon-config but it does not seem to work at all

HTML Code:
C:\Users\joeey\Desktop\Server Scripts\pawno\include\weapon-config.inc(5603) : warning 213: tag mismatch
C:\Users\joeey\Desktop\Server Scripts\pawno\include\weapon-config.inc(5870) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Line 5603:

PHP Code:
stock LeaveMessageFrom(playeridreason)
{
    new 
string[MAX_PLAYERS];
    if(
fexist(Tigress(playerid)))
    {
        
INI_ParseFile(Tigress(playerid), "TagNameForPlayer", .bExtra true, .extra playerid);
        if(
Account[playerid][Admin] >= 1)
        {
            switch(
reason)
            {
                case 
0format(stringsizeof(string), "..::|| {FFFF00}[Admin] {0088CA}%s %s telah keluar dari MalaysiaBestAsia {FF0000}(Timeout/Crash) {00CA00}||::.."Account[playerid][Tag], IsPlayerName(playerid));
                   case 
1format(stringsizeof(string), "..::|| {FFFF00}[Admin] {0088CA}%s %s telah keluar dari MalaysiaBestAsia {FF0000}(Pape Roger) {00CA00}||::.."Account[playerid][Tag], IsPlayerName(playerid));
                case 
2format(stringsizeof(string), "..::|| {FFFF00}[Admin] {0088CA}%s %s telah keluar dari MalaysiaBestAsia {FF0000}(Ditendang/Diharamkan) {00CA00}||::.."Account[playerid][Tag], IsPlayerName(playerid));
            }
            
SendClientMessageToAll(0x00CA00FFstring);
        }
        else
        {
            if(
Account[playerid][Vip] >= 1)
            {
                switch(
reason)
                {
                    case 
0format(stringsizeof(string), "..::|| {FF0000}[Vip] {0088CA}%s %s telah keluar dari MalaysiaBestAsia {FF0000}(Timeout/Crash) {00CA00}||::.."Account[playerid][Tag], IsPlayerName(playerid));
                       case 
1format(stringsizeof(string), "..::|| {FF0000}[Vip] {0088CA}%s %s telah keluar dari MalaysiaBestAsia {FF0000}(Pape Roger) {00CA00}||::.."Account[playerid][Tag], IsPlayerName(playerid));
                       case 
2format(stringsizeof(string), "..::|| {FF0000}[Vip] {0088CA}%s %s telah keluar dari MalaysiaBestAsia {FF0000}(Ditendang/Diharamkan) {00CA00}||::.."Account[playerid][Tag], IsPlayerName(playerid));
                }
                
SendClientMessageToAll(0x00CA00FFstring);
            }
            else
            {
                switch(
reason)
                {
                    case 
0format(stringsizeof(string), "..::|| {0088CA}%s %s telah keluar dari MalaysiaBestAsia {FF0000}(Timeout/Crash) {00CA00}||::.."Account[playerid][Tag], IsPlayerName(playerid));
                       case 
1format(stringsizeof(string), "..::|| {0088CA}%s %s telah keluar dari MalaysiaBestAsia {FF0000}(Pape Roger) {00CA00}||::.."Account[playerid][Tag], IsPlayerName(playerid));
                       case 
2format(stringsizeof(string), "..::|| {0088CA}%s %s telah keluar dari MalaysiaBestAsia {FF0000}(Ditendang/Diharamkan) {00CA00}||::.."Account[playerid][Tag], IsPlayerName(playerid));
                }
                
SendClientMessageToAll(0x00CA00FFstring);
            }
        }
    }
    else
    {
        if(
Account[playerid][Admin] >= 1)
        {
            switch(
reason)
            {
                case 
0format(stringsizeof(string), "..::|| {FFFF00}[Admin] {0088CA}%s telah keluar dari MalaysiaBestAsia {FF0000}(Timeout/Crash) {00CA00}||::.."IsPlayerName(playerid));
                   case 
1format(stringsizeof(string), "..::|| {FFFF00}[Admin] {0088CA}%s telah keluar dari MalaysiaBestAsia {FF0000}(Pape Roger) {00CA00}||::.."IsPlayerName(playerid));
                   case 
2format(stringsizeof(string), "..::|| {FFFF00}[Admin] {0088CA}%s telah keluar dari MalaysiaBestAsia {FF0000}(Ditendang/Diharamkan) {00CA00}||::.."IsPlayerName(playerid));
            }
            
SendClientMessageToAll(0x00CA00FFstring);
        }
        else
        {
               if(
Account[playerid][Vip] >= 1)
            {
                switch(
reason)
                {
                    case 
0format(stringsizeof(string), "..::|| {FF0000}[Vip] {0088CA}%s telah keluar dari MalaysiaBestAsia {FF0000}(Timeout/Crash){00CA00}||::.."IsPlayerName(playerid));
                    case 
1format(stringsizeof(string), "..::|| {FF0000}[Vip] {0088CA}%s telah keluar dari MalaysiaBestAsia {FF0000}(Pape Roger){00CA00}||::.."IsPlayerName(playerid));
                    case 
2format(stringsizeof(string), "..::|| {FF0000}[Vip] {0088CA}%s telah keluar dari MalaysiaBestAsia {FF0000}(Ditendang/Diharamkan){00CA00}||::.."IsPlayerName(playerid));
                }
                
SendClientMessageToAll(0x00CA00FFstring);
            }
            else
            {
                switch(
reason)
                {
                    case 
0format(stringsizeof(string), "..::|| {0088CA}%s telah keluar dari MalaysiaBestAsia {FF0000}(Timeout/Crash){00CA00}||::.."IsPlayerName(playerid));
                    case 
1format(stringsizeof(string), "..::|| {0088CA}%s telah keluar dari MalaysiaBestAsia {FF0000}(Pape Roger){00CA00}||::.."IsPlayerName(playerid));
                    case 
2format(stringsizeof(string), "..::|| {0088CA}%s telah keluar dari MalaysiaBestAsia {FF0000}(Ditendang/Diharamkan){00CA00}||::.."IsPlayerName(playerid));
                }
                
SendClientMessageToAll(0x00CA00FFstring);
            }
        }
    }
    return 
1;

Line 5870:

PHP Code:
            GetPlayerHealth(playeridheal);
            if(
heal 100 || Account[playerid][God] == 1)
            {
                
format(stringsizeof(string), "[DEATHMATCH] %s telah mencuba untuk menipu dengan Nyawa Infiniti dalam permainan!"IsPlayerName(playerid));
                
SendClientMessageToAll(0xFFFF00FFstring);
                
SetPlayerHealth(playerid100);
                
Account[playerid][God] = 0;
            }
        }
    }
    return 
1;

__________________
"Starting from the bottom now we here."
AfiqIqbal is offline   Reply With Quote
Old 15/12/2019, 02:37 PM   #2
Joe Staff
High-roller
 
Join Date: Aug 2007
Posts: 2,596
Reputation: 379
Default Re: weapon-config problem

Line 5870: make sure when 'heal' is being initialized, it's being initialized as a float.
pawn Code:
new float:heal;
Joe Staff is offline   Reply With Quote
Old 15/12/2019, 03:48 PM   #3
AfiqIqbal
Big Clucker
 
AfiqIqbal's Avatar
 
Join Date: Feb 2016
Location: Pahang, Malaysia
Posts: 71
Reputation: 0
Default Re: weapon-config problem

Quote:
Originally Posted by Joe Staff View Post
Line 5870: make sure when 'heal' is being initialized, it's being initialized as a float.
pawn Code:
new float:heal;
I already define it as a float
__________________
"Starting from the bottom now we here."
AfiqIqbal is offline   Reply With Quote
Old 15/12/2019, 04:52 PM   #4
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 958
Reputation: 167
Default Re: weapon-config problem

The warning and the error come from the include, not the gamemode code.

I will link you to the latest version:
https://github.com/oscar-broman/samp...nfig.inc#L5603
https://github.com/oscar-broman/samp...nfig.inc#L5870

As you can notice, the lines are not accurate so this means any of the options below (can be multiple):
- you use an older version of weapon-config
- you have outdated samp includes (without `bodypart` parameter)
- you have another outdated include that hooks without `bodypart` parameter.
__________________
Calisthenics is offline   Reply With Quote
Old 15/12/2019, 06:32 PM   #5
AfiqIqbal
Big Clucker
 
AfiqIqbal's Avatar
 
Join Date: Feb 2016
Location: Pahang, Malaysia
Posts: 71
Reputation: 0
Default Re: weapon-config problem

Quote:
Originally Posted by Calisthenics View Post
The warning and the error come from the include, not the gamemode code.

I will link you to the latest version:
https://github.com/oscar-broman/samp...nfig.inc#L5603
https://github.com/oscar-broman/samp...nfig.inc#L5870

As you can notice, the lines are not accurate so this means any of the options below (can be multiple):
- you use an older version of weapon-config
- you have outdated samp includes (without `bodypart` parameter)
- you have another outdated include that hooks without `bodypart` parameter.
I updated the weapon config, and all my includes .. same error
__________________
"Starting from the bottom now we here."
AfiqIqbal is offline   Reply With Quote
Old 15/12/2019, 08:11 PM   #6
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 958
Reputation: 167
Default Re: weapon-config problem

Can you post in which lines the error and the warning are so we can confirm if it is actually the `bodypart` parameter or something else?
Can you list all the includes the script uses?
Do you use `OnPlayerDamage` in the script and if you do, how is it defined (parameters in public function)?
__________________
Calisthenics is offline   Reply With Quote
Old 16/12/2019, 02:56 AM   #7
AfiqIqbal
Big Clucker
 
AfiqIqbal's Avatar
 
Join Date: Feb 2016
Location: Pahang, Malaysia
Posts: 71
Reputation: 0
Default Re: weapon-config problem

Quote:
Originally Posted by Calisthenics View Post
Can you post in which lines the error and the warning are so we can confirm if it is actually the `bodypart` parameter or something else?
Can you list all the includes the script uses?
Do you use `OnPlayerDamage` in the script and if you do, how is it defined (parameters in public function)?
1. I have already mention the lines where the error and the warning is located on my first post.

2. Sure .
PHP Code:
#include <a_samp>
#include <YSI\y_ini>
#include <sscanf2>
#include <zcmd>
#include <streamer>
#include <info>
#include <foreach>
#include <moneyhax>
#include <a_zones>
#include <SKY>
#include <weapon-config> 
3. Yes, I use OnPlayerDamage, and the function seems to work, no error and warning for that line came up, here's the line if you were curious about it.
PHP Code:
public OnPlayerDamage(playeridissueridFloat:amountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID && bodypart == 9)
    {
        
Account[issuerid][Headshot]++;
    }
    
//anti fake kill
    
DamageTaken[playerid] = 1;
    return 
1;

and FYI I actually used the include before (maybe last year) and it works, no error/warning, don't know why it happens now.
__________________
"Starting from the bottom now we here."
AfiqIqbal is offline   Reply With Quote
Old 16/12/2019, 07:40 AM   #8
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 958
Reputation: 167
Default Re: weapon-config problem

Change:
pawn Code:
public OnPlayerDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
to:
pawn Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
__________________
Calisthenics is offline   Reply With Quote
Old 16/12/2019, 07:47 AM   #9
AfiqIqbal
Big Clucker
 
AfiqIqbal's Avatar
 
Join Date: Feb 2016
Location: Pahang, Malaysia
Posts: 71
Reputation: 0
Default Re: weapon-config problem

Quote:
Originally Posted by Calisthenics View Post
Change:
pawn Code:
public OnPlayerDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
to:
pawn Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
OMG, I'm so stupid lol , thank you for your help man .. really appreciate it
__________________
"Starting from the bottom now we here."
AfiqIqbal 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
Weapon-config Admireal Scripting Help 1 01/09/2019 01:53 AM
[Ajuda] weapon-config Tiu_DaColombia Português/Portuguese 0 05/08/2019 05:53 PM
Need Help With Weapon-Config.inc travistaylor Scripting Help 0 13/08/2018 09:50 PM
weapon-config.inc crukk11 Scripting Help 24 20/05/2017 03:51 PM


All times are GMT. The time now is 04:08 AM.


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