SA-MP Forums Archive
Touch Object - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Touch Object (/showthread.php?tid=80964)



Touch Object - Kyle - 07.06.2009

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


Re: Touch Object - TheUllas - 07.06.2009

CreatePickup(1212,2,2618.4897,-1732.8961,6.6417);


Re: Touch Object - Kyle - 07.06.2009

Its not a pickup i want its a object


Re: Touch Object - shitbird - 07.06.2009

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


Re: Touch Object - TheUllas - 07.06.2009

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?


Re: Touch Object - Jakku - 07.06.2009

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


Re: Touch Object - shitbird - 07.06.2009

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.




Re: Touch Object - KeyWay - 07.06.2009

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.


Re: Touch Object - Kyle - 07.06.2009

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


Re: Touch Object - samgreen - 07.06.2009

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.