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:
I then:
Made the timer:
Added it to the OnPlayerDamage. Note: This isn't the full code.
Added to OnPlayerWeaponShot
When I added this it resulted in these 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.
I made:
PHP Code:
new God[MAX_PLAYERS];
PHP Code:
forward BrutalMDamageTimer(playerid);
PHP Code:
public BrutalMDamageTimer(playerid)
{
God[playerid] = 0;
return 1;
}
PHP Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
{
new DeathB;
new DeathS[128];
new Float:PlayerHealth;
GetPlayerHealth(playerid, PlayerHealth);
if(amount > PlayerHealth) {
SetPlayerHealth(playerid, 16);
return 0;
}
if (PlayerHealth - amount <= 15)
{
if(Character[playerid][BrutalM] == 0)
{
God[playerid] = 1;
GetPlayerPos(playerid, BMPos[playerid][0], BMPos[playerid][1], BMPos[playerid][2]);
Character[playerid][BrutalM] = 1;
Character[playerid][CanAccept] = 0;
LegHit[playerid] = 0;
SetTimer("BrutalMDamageTimer", 5000, false);
SetPlayerHealth(playerid, PlayerHealth-15);
format(DTextS, sizeof(DTextS), "(( %s is currently injured, type /damages %i for more info. ))", GetName(playerid), playerid);
label[playerid] = Create3DTextLabel(DTextS, COLOR_RED, BMPos[playerid][0], BMPos[playerid][1], BMPos[playerid][2], 10.0, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0, 0, 0.7);
if(Character[playerid][Level] <= 10)
{
DeathB = RandomEx(100, 500);
GivePlayerMoney(playerid, -DeathB);
format(DeathS, sizeof(DeathS), "EMT: Your Medical bills are $%i.", DeathB);
SCM(playerid, COLOR_LIGHTPINK, DeathS);
SCM(playerid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
SCM(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
}
else if(Character[playerid][Level] <= 20 && Character[playerid][Level] > 10)
{
DeathB = RandomEx(100, 750);
GivePlayerMoney(playerid, -DeathB);
format(DeathS, sizeof(DeathS), "EMT: Your Medical bills are $%i.", DeathB);
SCM(playerid, COLOR_LIGHTPINK, DeathS);
SCM(playerid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
SCM(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
}
else if(Character[playerid][Level] <= 30 && Character[playerid][Level] > 20)
{
DeathB = RandomEx(100, 1250);
GivePlayerMoney(playerid, -DeathB);
format(DeathS, sizeof(DeathS), "EMT: Your Medical bills are $%i.", DeathB);
SCM(playerid, COLOR_LIGHTPINK, DeathS);
SCM(playerid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
SCM(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
}
else if(Character[playerid][Level] > 30)
{
DeathB = RandomEx(100, 1500);
GivePlayerMoney(playerid, -DeathB);
format(DeathS, sizeof(DeathS), "EMT: Your Medical bills are $%i.", DeathB);
SCM(playerid, COLOR_LIGHTPINK, DeathS);
SCM(playerid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
SCM(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
return 0;
}
PHP Code:
forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(weaponid > 0)
{
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float: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] == 1 && issuerid != INVALID_PLAYER_ID)
GetPlayerPos(playerid, DPos2[playerid][0], DPos2[playerid][1], DPos2[playerid][2]);
Delete3DTextLabel(label[playerid]);
label2[playerid] = Create3DTextLabel("(( THIS PLAYER IS NOW DEAD ))", COLOR_RED, DPos2[playerid][0], DPos2[playerid][1], DPos2[playerid][2], 10.0, 0);
Attach3DTextLabelToPlayer(label2[playerid], playerid, 0, 0, 0.7);
Character[playerid][Dead] = 1;
Character[playerid][BrutalM] = 0;
SCM(playerid, COLOR_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", 999, true);
RTimer = SetTimerEx("RespawnTimer2", 60000, false, "i", playerid);
}
return 1;
{
PHP Code:
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(2370) : error 017: undefined symbol "WC_OnPlayerSpawn"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(2426) : error 017: undefined symbol "WC_OnPlayerRequestClass"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(2557) : error 017: undefined symbol "WC_OnPlayerDeath"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(2753) : error 017: undefined symbol "WC_OnPlayerStreamIn"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(2772) : error 017: undefined symbol "WC_OnPlayerEnterVehicle"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(3079) : error 017: undefined symbol "WC_OnPlayerDeath"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(3309) : error 017: undefined symbol "WC_OnPlayerDeath"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(3669) : error 006: must be assigned to an array
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(3715) : error 017: undefined symbol "WC_OnVehicleSpawn"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(3732) : error 017: undefined symbol "WC_OnVehicleDeath"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(3748) : error 017: undefined symbol "WC_OnPlayerEnterCheckpoint"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(4762) : error 017: undefined symbol "WC_OnPlayerDeath"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(4777) : error 017: undefined symbol "WC_OnPlayerDeath"
C:\Users\Austin\Desktop\stuff\skrt\pawno\include\weapon-config.inc(5448) : error 017: undefined symbol "WC_OnPlayerDamage"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\/modules/server/connection.pwn(50) : error 017: undefined symbol "SendAdminsMessage"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\/modules/server/connection.pwn(53) : error 017: undefined symbol "SendAdminsMessage"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\/modules/server/connection.pwn(56) : error 017: undefined symbol "SendAdminsMessage"
modules/business/functions.pwn(153) : error 017: undefined symbol "FormatNumber"
modules/business/functions.pwn(193) : error 017: undefined symbol "FormatNumber"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1095) : error 017: undefined symbol "SetPlayerPosEx"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1097) : error 017: undefined symbol "SetPlayerPosEx"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1101) : error 017: undefined symbol "SetPlayerPosEx"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1105) : error 017: undefined symbol "SetPlayerPosEx"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1111) : error 017: undefined symbol "SetPlayerPosEx"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1115) : error 017: undefined symbol "SetPlayerPosEx"
C:\Users\Austin\Desktop\stuff\skrt\gamemodes\SCRP-R39.pwn(1121) : error 017: undefined symbol "SetPlayerPosEx"
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
26 Errors.