31.12.2014, 10:44
After I switched to MySQL( i think ), OnPlayerTakeDamage & OnPlayerGiveDamage stopped working.
I tried debugging to see what's going on, but NOTHING is being called!
Any ideas what's wrong? ;_;
I tried debugging to see what's going on, but NOTHING is being called!
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
print("onplayertakedamage start");
if(issuerid != INVALID_PLAYER_ID)
{
print("not invalid issuerid");
if(SpawnMode[ issuerid ] == SPAWNMODE_SNIPERDM || SpawnMode[ issuerid ] == SPAWNMODE_FREEFORALL)
{
if(weaponid == WEAPON_SNIPER && bodypart == 9)
{
GameTextForPlayer(playerid, "~r~~n~~n~~n~~n~~n~HEADSHOT", 1500, 3);
SendClientMessage(issuerid, COLOR_RADIO, "Player shot in the head - Instant kill!");
SetPlayerHealth(playerid, 0);
}
}
if(!GodMode{ playerid })
{
PlayerPlaySound(issuerid, 17802, 0, 0, 0);
}
else
{
GameTextForPlayer(issuerid, "~g~TARGET HAS GODMODE", 3000, 3);
}
if(AdminDuty{ playerid })
{
GameTextForPlayer(issuerid, "~r~~h~DON'T ATTACK ON-DUTY ADMINS", 3000, 3);
}
}
print("onplayertakedamage end");
return 1;
}