SA-MP Forums Archive
GodMode Script - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GodMode Script (/showthread.php?tid=587493)



GodMode Script - Harith - 31.08.2015

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


Re: GodMode Script - Alex Magaсa - 31.08.2015

https://www.******.gr/search?q=samp+...od+mode+script


Re: GodMode Script - Harith - 31.08.2015

I'm Already Search For It Just Want A Function For The GodMode Player Can't Shoot Other Player


Re: GodMode Script - jlalt - 31.08.2015

not sure about this
PHP код:
#include a_samp
#include zcmd
new god1[MAX_PLAYERS];
CMD:god(playerid,params[])
{
if(
IsPlayerAdmin(playerid)) {
if(
god1[playerid] == 0) {
SetPlayerHealth(playerid99999);
SendClientMessage(playerid,-1,"God Mode Turned On.");
} else if(
god1[playerid] == 1) {
SetPlayerHealth(playerid100);
SendClientMessage(playerid,-1,"God Mode Turned off.");

} else 
SendClientMessage(playerid,-1,"You need to Be RCON to use this command.");
return 
1;
}
public 
OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart)
{
  if(
god1[playerid] == 1) {
    
SendClientMessage(playerid0xFFFFFFFF"You are not allowed to shot players when god mode on.");
    return 
0;
   }
  return 
1;
}
public 
OnPlayerSpawn(playerid)
{
if(
god1[playerid] == 1) {
SetPlayerHealth(playerid99999);
}
return 
1;
}
public 
OnPlayerConnect(playerid)
{
god1[playerid] = 0;
return 
1;




Re: GodMode Script - MarvinPWN - 31.08.2015

PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    if(
hittype == 1)
    {
        if(
GodMode[hitid] == 1)
        {
            return 
0;
        }
    }
    return 
1;

GodMode is the variable in which you set if the player has godmode.


Re: GodMode Script - Alex Magaсa - 31.08.2015

This may help you:

https://sampforum.blast.hk/showthread.php?tid=493710&page=2


Re: GodMode Script - Harith - 31.08.2015

Thx Guys I Will Try It


Re: GodMode Script - Boot - 31.08.2015

Код:
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;
}