Code: Select all
player iprintln("health: " + player.health);
player.health += 100;
player iprintln("health2: " + player.health);

Moderator: Core Staff
Code: Select all
player iprintln("health: " + player.health);
player.health += 100;
player iprintln("health2: " + player.health);
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Code: Select all
o notsolid();
self waittill("trigger", user);
if(user.health<100)
{ //not at full health
if(health=="big")
{
Code: Select all
o notsolid();
self waittill("trigger", user);
if(user.health ==< 100)
{ //not at full health
if(health=="big")
{
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Code: Select all
setupitemForPickup(item_name, item_xmodel, soundalias, delay)
{
precachemodel(item_xmodel);
trig = getentarray("item_pickup_" +item_name,"targetname");
org = getentarray("item_origin_" +item_name,"targetname");
if(org.size == trig.size) //same ammount of origins and triggers, otherwise you get errors
{
for(i=0;i<org.size;i++)
{
trig[i] thread itemPickup(org[i], item_name, item_xmodel, soundalias, delay);
}
}
}
itemPickup(o, item, xmodel, sound, delay){
for(;;){
o setmodel(xmodel);
o notsolid(); //already true, just not sure about all script_models
self waittill("trigger", user);
self.maxhealth = 200;
user thread super_health(delay);
o playsound("weap_pickup");
wait 10; //to prevent unlimited ammo while staying inside the trigger
o playsound(sound);
o hide();
self maps\mp\_utility::TriggerOff();
if(isdefined(delay))
wait delay;
self maps\mp\_utility::TriggerOn();
o playsound("spawnsound");
o show();
}
}
super_health(delay){
self endon("killed_player");
if(!isDefined(delay)
delay = 20; // 20s delay
if(delay <= 0)
delay = 20;
for(i = delay; i >= 0; i--){
if(player.health <= 100)
return;
if(i > 15)
self iprintln(i + "seconds left");
// you can play a warning sound here
// self playsound("warning"); e.g.
wait 1;
}
}
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Code: Select all
bad syntax: (file 'maps/mp/_health_pickup.gsc', line 75)
delay = 20; // 20s delay
*
Code: Select all
if(!isDefined(delay))
delay = 20; // 20s delay
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Code: Select all
super_health(delay){
self endon("killed_player");
if(!isDefined(delay))
delay = 20; // 20s delay
if(delay <= 0)
delay = 20;
for(i = delay; i >= 0; i--){
if(player.health <= 100)
return;
if(i > 15)
self iprintln(i + "seconds left");
// you can play a warning sound here
// self playsound("warning"); e.g.
wait 1;
}
if(player.health > 100)
player.health = 10;
}
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Code: Select all
if(player.health > 100)
player.health = 100; //*
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
But like I said.... I removed the whole delay script but then the healthpack doesn't get removed and you don't get 200 health ?waywaaaard wrote:here forgot to reset the health though![]()
Code: Select all
super_health(delay){ self endon("killed_player"); if(!isDefined(delay)) delay = 20; // 20s delay if(delay <= 0) delay = 20; for(i = delay; i >= 0; i--){ if(player.health <= 100) return; if(i > 15) self iprintln(i + "seconds left"); // you can play a warning sound here // self playsound("warning"); e.g. wait 1; } if(player.health > 100) player.health = 10; }
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Users browsing this forum: No registered users and 1 guest