Two SA-MP questions (scripting)
#1

Hello.

I need help with my new filterscript (Property System) - pickups.

I need two things. First:

Player is on position X=174 Y=637 Z=15. I want make a place here, where player can get money (10,000$). But... Here I need a money pickup (ID 1274) and it appears after 60 seconds after I pick up it. If I pick up this, i get 10,000$.

And second:

I want a place, where player get information about property. Here is house icon (ID 1273). If player pick up it, player gets information on the center of screen (with GameTextForPlayer). But the pickup doesn't disappears. I need the text, here is example of one house:

~w~House ID: 624
~w~House type ID: 19
~w~Price: 500,000,000$*
~w~Sell: 250,000,000$
~w~Owner: For Sale

Thanks for help.

* - yes, too big. But if player buy a property, he can enter a house (when he buy - it's empty). Inside the house there is marker where player can buy furniture and something other.
Reply
#2

Hi, look here:

https://sampwiki.blast.hk/wiki/CreatePickup

and here is the spawn types for pickups:

https://sampwiki.blast.hk/wiki/PickupTypes
Reply
#3

Quote:
Originally Posted by _❼_
This is really good. But I already need help with "Pick up to get 10,000$"...

Yes, it is working

And I know how to make this first, thanks for anwser, _❼_
Reply
#4

Ok guys, can you now help me?

I see this error: error 021: symbol already defined: "OnPlayerPickUpPickup". Can you guys fix it? These Armour, Health, HouseIcon and other works perfectly.

Код:
//Health pickups
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if (pickupid == Health)
	{
	SetPlayerHealth(playerid,100);
	GameTextForPlayer(playerid, "~y~You have found some health!", 5000, 3);
	}
	return 1;
}

//Armor pickups
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if (pickupid == Armour)
	{
	SetPlayerArmour(playerid,100);
	GameTextForPlayer(playerid, "~y~You have found an armor!", 5000, 3);
	}
	return 1;
}
Reply
#5

Lol, you only define one callback, and put everything under it

No need for several, do it like below:

pawn Код:
//Health pickups
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if (pickupid == Health)
    {
    SetPlayerHealth(playerid,100);
    GameTextForPlayer(playerid, "~y~You have found some health!", 5000, 3);
    }
    if (pickupid == Armour)
    {
    SetPlayerArmour(playerid,100);
    GameTextForPlayer(playerid, "~y~You have found an armor!", 5000, 3);
    }
    return 1;
}
Reply
#6

Ok! Thanks for help
Reply
#7

No problem, PM me if you need any more help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)