31.08.2015, 10:30
Hi Guys Im Need Your Help I Have A GodMode Script And I Want To Make The GodMode Player Can't Shoot Other Player Any Idea Guys Sorry For My Bad English
#include a_samp
#include zcmd
new god1[MAX_PLAYERS];
CMD:god(playerid,params[])
{
if(IsPlayerAdmin(playerid)) {
if(god1[playerid] == 0) {
SetPlayerHealth(playerid, 99999);
SendClientMessage(playerid,-1,"God Mode Turned On.");
} else if(god1[playerid] == 1) {
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid,-1,"God Mode Turned off.");
}
} else SendClientMessage(playerid,-1,"You need to Be RCON to use this command.");
return 1;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(god1[playerid] == 1) {
SendClientMessage(playerid, 0xFFFFFFFF, "You are not allowed to shot players when god mode on.");
return 0;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(god1[playerid] == 1) {
SetPlayerHealth(playerid, 99999);
}
return 1;
}
public OnPlayerConnect(playerid)
{
god1[playerid] = 0;
return 1;
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == 1)
{
if(GodMode[hitid] == 1)
{
return 0;
}
}
return 1;
}
new Godmode[MAX_PLAYERS]; CMD:god(playerid) { if(Godmode[playerid] == false) { SetPlayerHealth(playerid, cellmax); ResetPlayerWeapons(playerid); GameTextForPlayer(playerid, "~g~God mode enabled", 3000, 3); Godmode[playerid] = true; } else { SetPlayerHealth(playerid, 100); GameTextForPlayer(playerid, "~g~God mode disabled", 3000, 3); Godmode[playerid] = false; } return 1; } public OnPlayerSpawn(playerid) { if(Godmode[playerid] == true) { SetPlayerHealth(playerid, cellmax); ResetPlayerWeapons(playerid); } return 1; }