AddStaticPickup Problems?
#1

I wanted to add health and armor, but when I spawn and walk into them, they do not get added to my health?
heres the code, PLEASE HELP IF YOU KNOW!

Quote:

AddStaticPickup(1240,100,1999.5643,1538.5498,13.58 59); // Health
AddStaticPickup(1242,100,2002.3348,1538.3422,13.58 59); // Armor
AddStaticPickup(1242,100,2247.1326,2440.3210,10.82 03); // Armor
AddStaticPickup(1240,100,2247.3728,2445.7075,10.82 03); // Health
AddStaticPickup(1240,100,2622.4658,1188.0048,10.82 03); // Health
AddStaticPickup(1242,100,2622.1086,1191.4950,10.81 30); // Armor

Reply
#2

Quote:
Originally Posted by DeltaAirlines12
I wanted to add health and armor, but when I spawn and walk into them, they do not get added to my health?
heres the code, PLEASE HELP IF YOU KNOW!

Quote:

AddStaticPickup(1240,1,1999.5643,1538.5498,13.5859 ); // Health
AddStaticPickup(1242,1,2002.3348,1538.3422,13.5859 ); // Armor
AddStaticPickup(1242,1,2247.1326,2440.3210,10.8203 ); // Armor
AddStaticPickup(1240,1,2247.3728,2445.7075,10.8203 ); // Health
AddStaticPickup(1240,1,2622.4658,1188.0048,10.8203 ); // Health
AddStaticPickup(1242,1,2622.1086,1191.4950,10.8130 ); // Armor

do
pawn Код:
#include <a_samp>

new health1,health2,health3;
new armour1,armour2,armour3

public OnGameModeInIt()
{
  health1 = CreatePickup(1240,1,1999.5643,1538.5498,13.5859); // Health
  armour1 = CreatePickup(1242,1,2002.3348,1538.3422,13.5859); // Armor
  armour2 = CreatePickup(1242,1,2247.1326,2440.3210,10.8203); // Armor
  health2 = CreatePickup(1240,1,2247.3728,2445.7075,10.8203); // Health
  health3 = CreatePickup(1240,1,2622.4658,1188.0048,10.8203); // Health
  armour = CreatePickup(1242,1,2622.1086,1191.4950,10.8130); // Armor
    return 1;
 }
 
public OnPlayerPickupPickup(playerid,pickupid)
{
    if(pickupid == Healt1||pickupid == Healt2||pickupid == Healt3)
    {
         SetPlayerHealth(playerid,100.0);
    }
    if(pickupid == armour1||pickupid == armour2||pickupid == armour3)
    {
        SetPlayerArmour(playerid,100.0);
    }
    return 1;
}
use CreatePickup because it return the pickup id, AddStaticPickup doesn't.
Reply
#3

Quote:
Originally Posted by Yuryfury
Quote:
Originally Posted by DeltaAirlines12
I wanted to add health and armor, but when I spawn and walk into them, they do not get added to my health?
heres the code, PLEASE HELP IF YOU KNOW!

Quote:

AddStaticPickup(1240,1,1999.5643,1538.5498,13.5859 ); // Health
AddStaticPickup(1242,1,2002.3348,1538.3422,13.5859 ); // Armor
AddStaticPickup(1242,1,2247.1326,2440.3210,10.8203 ); // Armor
AddStaticPickup(1240,1,2247.3728,2445.7075,10.8203 ); // Health
AddStaticPickup(1240,1,2622.4658,1188.0048,10.8203 ); // Health
AddStaticPickup(1242,1,2622.1086,1191.4950,10.8130 ); // Armor

do
pawn Код:
#include <a_samp>

new health1,health2,health3;
new armour1,armour2,armour3

public OnGameModeInIt()
{
  health1 = CreatePickup(1240,1,1999.5643,1538.5498,13.5859); // Health
  armour1 = CreatePickup(1242,1,2002.3348,1538.3422,13.5859); // Armor
  armour2 = CreatePickup(1242,1,2247.1326,2440.3210,10.8203); // Armor
  health2 = CreatePickup(1240,1,2247.3728,2445.7075,10.8203); // Health
  health3 = CreatePickup(1240,1,2622.4658,1188.0048,10.8203); // Health
  armour = CreatePickup(1242,1,2622.1086,1191.4950,10.8130); // Armor
    return 1;
 }
 
public OnPlayerPickupPickup(playerid,pickupid)
{
    if(pickupid == Healt1||pickupid == Healt2||pickupid == Healt3)
    {
         SetPlayerHealth(playerid,100.0);
    }
    if(pickupid == armour1||pickupid == armour2||pickupid == armour3)
    {
        SetPlayerArmour(playerid,100.0);
    }
    return 1;
}
use CreatePickup because it return the pickup id, AddStaticPickup doesn't.
Thanks so so so much!
Reply
#4

+1 ... You can't simply make pickups and expect the script to do what you need it to do...

Think of it this way. Pawno is stupid. You are smart. You must tell Pawno what you want to do in order for it do preform the task.
Reply
#5

Quote:
Originally Posted by [SAP
Sidhu ]
+1 ... You can't simply make pickups and expect the script to do what you need it to do...

Think of it this way. Pawno is stupid. You are smart. You must tell Pawno what you want to do in order for it do preform the task.
Hmmm, you have a point!
XD, now I'm convinced!
FUCK PAWNO!!!!!!!!

: D
Reply
#6

Quote:
Originally Posted by DeltaAirlines12
Quote:
Originally Posted by [SAP
Sidhu ]
+1 ... You can't simply make pickups and expect the script to do what you need it to do...

Think of it this way. Pawno is stupid. You are smart. You must tell Pawno what you want to do in order for it do preform the task.
Hmmm, you have a point!
XD, now I'm convinced!
FUCK PAWNO!!!!!!!!

: D
lmao he dose have a point tho
Reply
#7

happy to help :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)