Touch Object
#1

Hai, How would i do it so that when i touch a certain object or make contact with it. It gives me 10$ ?

Thanks Kyle
Reply
#2

CreatePickup(1212,2,2618.4897,-1732.8961,6.6417);
Reply
#3

Its not a pickup i want its a object
Reply
#4

or you could use PlayerToPoint on the Object's coordinates, and then do whatever you want to do.
Reply
#5

Or:
new Cash;

public OnGameModeInit()
Cash = CreatePickup(1274,2,2498.9319,-1686.2655,12.9870);

public OnPlayerPickUpPickup(playerid, pickupid)
{
if (pickupid == Cash)
{
GameTextForPlayer(playerid,"~w~You just got 10 Dollars~w~!!!",5000,4);
GivePlayerMoney(playerid,10);
return 1;
}
Why do you want an object anyway?
Reply
#6

Why not just use it like a pickup? Easier to make for you
Reply
#7

Because CreatePickup is bugged in 0.2X.

Quote:

CreatePickup - Pickup ids are often different for different players. I presume it is a problem with keeping track of them and assigning ids for players. This affects OnPlayerPickUpPickup and DestroyPickup as they will be used with different pickups for players.

Reply
#8

You could make a object wherever you want, and make PlayerToPoint, and whenever player steps in that point he gets the 10$, simple as that.
Reply
#9

Is there a easier way to do it due to i have like 75 objects i need to apply it to.
Reply
#10

Quote:
Originally Posted by KyleSmith
Is there a easier way to do it due to i have like 75 objects i need to apply it to.
Store the coordinates of the objects in an array, then iterate over the objects in a timer.
Reply


Forum Jump:


Users browsing this thread: