31.05.2020, 14:32
(
Last edited by Filbert; 01/06/2020 at 08:27 AM.
)
i'm using weapon-config.inc by Slice and couldnt use the /kill and /class commands. They were unknown command..
Here's the code :
EDIT: It's the OnPlayerDamage() errors maybe ? idk but here's the code, i cant find anything wrong with it
Every action that uses SetPlayerHealth is bugged. How to fix this?
Here's the code :
pawn Code:
CMD:class(playerid, params[])
{
SetPlayerHealth(playerid,0);
SendClientMessage(playerid,COLOR_GREEN,"[CLASS]You have been force to the class section");
ForceClassSelection(playerid);
return 1;
}
CMD:kill(playerid,params[]) {
new string[128];
if(IsSpawned[playerid] == 1)
{
if(PlayerInfo[playerid][God] == 1) return SendClientMessage(playerid, red, "ERROR: You are in the god mode. /god to deactivate it");
if(OnFly[playerid] == true) return SendClientMessage(playerid, red, "ERROR: You are in the fly mode. /fly to deactivate it");
if(cuffed[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You are in Hand Cuffs and cannot kill yourself!");
if(IsPlayerInAnyVehicle(playerid)) {
if(VehicleInfo[GetPlayerVehicleID(playerid)][Temp] == 1) SetTimerEx("EraseVehicle", 10000,0,"i",GetPlayerVehicleID(playerid));
}
new Float:health;
if(GetPlayerHealth(playerid, health) >0) {
SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
SetPlayerHealth(playerid,0);
format(string, sizeof(string), "[DEATH]: %s Has Just Killed His Retarded Self /Kill", pName(playerid));
SendClientMessageToAll(COLOR_YELLOW, string);
return 1;
}
}
return 1;
}
pawn Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weaponid, &bodypart)
{
if(PlayerInfo[playerid][team] == PlayerInfo[issuerid][team] && InDuel[playerid] == 0 && InDuel[issuerid] == 0 && InDM[playerid] == 0 && InDM[issuerid] == 0)
{
GameTextForPlayer(issuerid, "~<~ ~r~Team killing is not allowed ~>~", 1000, 5);
return 0;
}
if(event_type == TDM && p_team[issuerid] == p_team[playerid] && InDuel[playerid] == 0 && InDuel[issuerid] == 0 && InDM[playerid] == 0 && InDM[issuerid] == 0)
{
GameTextForPlayer(issuerid, "~<~ ~r~Team killing is not allowed ~>~", 1000, 5);
return 0;
}
if(PlayerInfo[issuerid][HitSound] == 1) SetDamageSounds(0, 17802);
if(PlayerInfo[playerid][God] == 1) return 0;
if(OnFly[playerid] == true) return 0;
return 1;
}