need simple help with this script
#1

this health system edit on onplayerupdate or onplayertakedamage plz help me
Reply
#2

Usage OnPlayerUpdate ex:

PHP код:
public OnPlayerUpdate(playerid){
    new 
Float:health;
    
GetPlayerHealth(playerid,health);
    if (
health 50.0) {SendClientMessage(playerid, -1#Warning);}
    
return true;

Reply
#3

but bro this is not attach with cmds how i attach this with cmd when player take damage and cmd stop work and sendclientmessage you cannot use this cmd while you in a fight or lossing health -_-
Reply
#4

samp hard scripters plz help me i am new learn scripting
Reply
#5

lol this is example:
PHP код:
CMD:killme(playerid,params[]) {
new 
Float:health;
GetPlayerHealth(playerid,health);
if (
health 99.0) { SendClientMessage(playerid, -1"Your health full can't use this command :)");}
else {
SetPlayerHealth(playerid,0);
}
return 
1;

If you did not understand send your code and tell us what you want to make the code fail
Reply
#6

trying this
Reply
#7

forward dialog3(playerid);
public dialog3(playerid)
{
SetTimerEx( "dialog3", 15000, false, "i",playerid);
SendClientMessage(playerid,red,"[NGP]: you cannot use cmds while you in a fight or lossing health");
return 1;
}

i create this and attach with cmd but its not work
Reply
#8

PHP код:
forward dialog3(playerid);
public 
dialog3(playerid)
{
new 
Float:health;
GetPlayerHealth(playerid,health);
if (
health 80.0) {
SendClientMessage(playerid,red,"[NGP]: you cannot use cmds while you in a fight or lossing health");
}else{
SetTimerEx"dialog3"15000false"i",playerid);
}
return 
1;

Reply
#9

but cmd working i want cmd not work when some one take damage for 10 sec
Reply
#10

make your health 79 and try to use it

Edit:
On player get demage for 10 seconds will can't use this command and if died / 10 seconds left without demage will be able to use it
PHP код:

public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    
SetPVarInt(playerid,"health22",1);
    
SetTimerEx"health21"10000false"i",playerid);
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
SetPVarInt(playerid,"health22",0);
return 
1;
}
forward dialog3(playerid);
public 
dialog3(playerid)
{
if(
GetPVarInt(playerid"health22") == 1) {
SendClientMessage(playerid,-1,"[NGP]: you cannot use cmds while you in a fight or lossing health");
}else{
SetTimerEx"dialog3"15000false"i",playerid);
}
return 
1;
}
forward health21(playerid);
public 
health21(playerid)
{
SetPVarInt(playerid,"health22",0);
return 
1;

PS: if didn't work give me your command
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)