auto disable god
#1

hey how to I script an auto disable god for when a player type /godmode and they shoot/punch the the player it will disable godmode for them?
Код:
if(PlayerAcc[playerid][God] == 1)
Reply
#2

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
    if(PlayerAcc[playerid][God] == 1) PlayerAcc[playerid][God] = 0;
    return 1;
}
Reply
#3

Use this callback.
PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
 if(
PlayerAcc[playerid][God] == 1)
 {
 
PlayerAcc[playerid][God] = 0;
SetPlayerHealth(playerid100);
 }
return 
1;

Reply
#4

thanks you all +rep
Reply
#5

I also need help with this code, I cant fix it
Код:
public OnPlayerTakeDamage( playerid, issuerid, Float:amount, weaponid )
{
	new Float:h;
	GetPlayerHealth(playerid, h);
	if (PlayerAcc[playerid][God] == 1 && h == FLOAT_INFINITY)
	{
	GameTextForPlayer(playerid, "~r~The player you're trying to hit has ~g~god mode activated~r~!", 5000, 5);
	}
	return 1;
}
Reply
#6

PHP код:
GameTextForPlayer(issuerid"~r~The player you're trying to hit has ~g~god mode activated~r~!"50005); 
I'm guessing you need this game text to be shown for the shooter; therefor you need to use issuerid instead of playerid.
Reply
#7

Quote:
Originally Posted by youssefehab500
Посмотреть сообщение
PHP код:
GameTextForPlayer(issuerid"~r~The player you're trying to hit has ~g~god mode activated~r~!"50005); 
I'm guessing you need this game text to be shown for the shooter; therefor you need to use issuerid instead of playerid.
thx man +rep
Reply
#8

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
    if(PlayerAcc[playerid][God] == 1) PlayerAcc[playerid][God] = 0;
    return 1;
}
it's saying
Quote:

error 025: function heading differs from prototype

Reply
#9

Cool Idea bro gonna use this on my gamemode work in progress
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)