Variable Errors
#1

So, I'll plan out what I did and it resulted in a lot of errors that have nothing to do with the code, so I have a feeling a a possible bracket is missing or in the wrong place.

I made:
PHP код:
new God[MAX_PLAYERS]; 
I then:
PHP код:
forward BrutalMDamageTimer(playerid); 
Made the timer:
PHP код:
public BrutalMDamageTimer(playerid)
{
    
God[playerid] = 0;
    return 
1;

Added it to the OnPlayerDamage. Note: This isn't the full code.
PHP код:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
{
       new 
DeathB;
    new 
DeathS[128];
    new 
Float:PlayerHealth;
    
GetPlayerHealth(playeridPlayerHealth);
    if(
amount PlayerHealth) {
    
SetPlayerHealth(playerid16);
    return 
0;
    }
    if (
PlayerHealth amount <= 15)
    {
        if(
Character[playerid][BrutalM] == 0)
           {
               
God[playerid] = 1;
            
GetPlayerPos(playeridBMPos[playerid][0], BMPos[playerid][1], BMPos[playerid][2]);
            
Character[playerid][BrutalM] = 1;
            
Character[playerid][CanAccept] = 0;
            
LegHit[playerid] = 0;
            
SetTimer("BrutalMDamageTimer"5000false);
            
SetPlayerHealth(playeridPlayerHealth-15);
            
format(DTextSsizeof(DTextS), "(( %s is currently injured, type /damages %i for more info. ))"GetName(playerid), playerid);
            
label[playerid] = Create3DTextLabel(DTextSCOLOR_REDBMPos[playerid][0], BMPos[playerid][1], BMPos[playerid][2], 10.00);
            
Attach3DTextLabelToPlayer(label[playerid], playerid000.7);
            if(
Character[playerid][Level] <= 10)
            {
                
DeathB RandomEx(100500);
                
GivePlayerMoney(playerid, -DeathB);
                
format(DeathSsizeof(DeathS), "EMT: Your Medical bills are $%i."DeathB);
                
SCM(playeridCOLOR_LIGHTPINKDeathS);
                
SCM(playeridCOLOR_LIGHTRED"You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
                
SCM(playeridCOLOR_LIGHTRED"To accept death type /acceptdeath");
            }
            else if(
Character[playerid][Level] <= 20 && Character[playerid][Level] > 10)
            {
                
DeathB RandomEx(100750);
                
GivePlayerMoney(playerid, -DeathB);
                
format(DeathSsizeof(DeathS), "EMT: Your Medical bills are $%i."DeathB);
                
SCM(playeridCOLOR_LIGHTPINKDeathS);
                
SCM(playeridCOLOR_LIGHTRED"You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
                
SCM(playeridCOLOR_LIGHTRED"To accept death type /acceptdeath");
            }
            else if(
Character[playerid][Level] <= 30 && Character[playerid][Level] > 20)
            {
                
DeathB RandomEx(1001250);
                
GivePlayerMoney(playerid, -DeathB);
                
format(DeathSsizeof(DeathS), "EMT: Your Medical bills are $%i."DeathB);
                
SCM(playeridCOLOR_LIGHTPINKDeathS);
                
SCM(playeridCOLOR_LIGHTRED"You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
                
SCM(playeridCOLOR_LIGHTRED"To accept death type /acceptdeath");
            }
            else if(
Character[playerid][Level] > 30)
            {
                
DeathB RandomEx(1001500);
                
GivePlayerMoney(playerid, -DeathB);
                
format(DeathSsizeof(DeathS), "EMT: Your Medical bills are $%i."DeathB);
                
SCM(playeridCOLOR_LIGHTPINKDeathS);
                
SCM(playeridCOLOR_LIGHTRED"You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
                
SCM(playeridCOLOR_LIGHTRED"To accept death type /acceptdeath");
                return 
0;
            } 
Added to OnPlayerWeaponShot
PHP код:

        forward OnPlayerWeaponShot
(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ);
public 
OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    if(
weaponid 0)
    {
        public 
OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
        {
            if(
hittype == BULLET_HIT_TYPE_PLAYER && God[hitid] == 1)
            {
                return 
0;
            }
            if(
hittype == BULLET_HIT_TYPE_PLAYER && God[hitid] == 0)
            {
            if(
Character[playerid][BrutalM] == && issuerid != INVALID_PLAYER_ID)
            
GetPlayerPos(playeridDPos2[playerid][0], DPos2[playerid][1], DPos2[playerid][2]);
            
Delete3DTextLabel(label[playerid]);
            
label2[playerid] = Create3DTextLabel("(( THIS PLAYER IS NOW DEAD ))"COLOR_REDDPos2[playerid][0], DPos2[playerid][1], DPos2[playerid][2], 10.00);
            
Attach3DTextLabelToPlayer(label2[playerid], playerid000.7);
            
Character[playerid][Dead] = 1;
            
Character[playerid][BrutalM] = 0;
            
SCM(playeridCOLOR_YELLOW">> You are now dead. You can use /respawnme after 60 seconds to respawn.");
            
Character[playerid][CanSpawn] = 0;
            
KillTimer(DeathT);
            
RespawnT 60;
            
RespawnEx SetTimer("RespawnTimer"999true);
            
RTimer SetTimerEx("RespawnTimer2"60000false"i"playerid);
    }
                return 
1;
        { 
When I added this it resulted in these errors:
PHP код:
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(2370) : error 017undefined symbol "WC_OnPlayerSpawn"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(2426) : error 017undefined symbol "WC_OnPlayerRequestClass"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(2557) : error 017undefined symbol "WC_OnPlayerDeath"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(2753) : error 017undefined symbol "WC_OnPlayerStreamIn"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(2772) : error 017undefined symbol "WC_OnPlayerEnterVehicle"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(3079) : error 017undefined symbol "WC_OnPlayerDeath"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(3309) : error 017undefined symbol "WC_OnPlayerDeath"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(3669) : error 006must be assigned to an array
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(3715) : error 017undefined symbol "WC_OnVehicleSpawn"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(3732) : error 017undefined symbol "WC_OnVehicleDeath"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(3748) : error 017undefined symbol "WC_OnPlayerEnterCheckpoint"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(4762) : error 017undefined symbol "WC_OnPlayerDeath"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(4777) : error 017undefined symbol "WC_OnPlayerDeath"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(5448) : error 017undefined symbol "WC_OnPlayerDamage"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\/modules/server/connection.pwn(50) : error 017undefined symbol "SendAdminsMessage"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\/modules/server/connection.pwn(53) : error 017undefined symbol "SendAdminsMessage"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\/modules/server/connection.pwn(56) : error 017undefined symbol "SendAdminsMessage"
modules/business/functions.pwn(153) : error 017undefined symbol "FormatNumber"
modules/business/functions.pwn(193) : error 017undefined symbol "FormatNumber"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1095) : error 017undefined symbol "SetPlayerPosEx"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1097) : error 017undefined symbol "SetPlayerPosEx"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1101) : error 017undefined symbol "SetPlayerPosEx"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1105) : error 017undefined symbol "SetPlayerPosEx"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1111) : error 017undefined symbol "SetPlayerPosEx"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1115) : error 017undefined symbol "SetPlayerPosEx"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1121) : error 017undefined symbol "SetPlayerPosEx"
Compilation aborted.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
26 Errors

If you can help I will definitely rep you, if you would like to see more code and could help over a quicker way to contact me feel free to message me for my Skype or Discord in my signature. Thank you.
Reply
#2

I just realized I was using OnPlayerWeaponShot twice, I removed it but I'm still getting errors.
Reply
#3

i think you must update you weapon-config.inc include
Reply
#4

PHP код:
error 017undefined symbol "SetPlayerPosEx" 
means this function doesn't exist!

other errors are comming from the include
Reply
#5

Fixed it, thank you anyways.
Reply
#6

The errors were pretty self explanatory, the errors you had were easy to fix if you know what you're actually doing.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)