Help Create Pickup ... - 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)
+--- Thread: Help Create Pickup ... (
/showthread.php?tid=352319)
Help Create Pickup ... -
Eiy Mard - 19.06.2012
hey ... can i know .. how can i make like this ?? if i get the pickup ... gametext will out ...
>>>>>
Re: Help Create Pickup ... -
[MM]RoXoR[FS] - 19.06.2012
On top add
Create Pickup
pawn Code:
public OnGameModeInit()
{
police = CreatePickup(id,1,x,y,z,-1);//Replace id, x,y,z with id of pickup and it's location
return 1;
}
Show GameText
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == police)
{
//Show Gametext here
}
return 1;
}
Usefull Links :
https://sampwiki.blast.hk/wiki/CreatePickup How to create a pickup
https://sampwiki.blast.hk/wiki/PickupTypes Types of Pickup
https://sampwiki.blast.hk/wiki/Game_Object_ID_List Object ID's
https://sampwiki.blast.hk/wiki/GameTextForPlayer Game Text
I think it would be
better to use textdraw instead of GameText
Re: Help Create Pickup ... -
Eiy Mard - 19.06.2012
oh .. ty very much man ...
Re: Help Create Pickup ... -
vIBIENNYx - 19.06.2012
I would suggest putting all of your pickups inside an array, for example:
When you create the pickup you do the same except:
pawn Code:
public OnGameModeInit()
{
policepickup[1] = CreatePickup(id,1,x,y,z,-1);//Replace id, x,y,z with id of pickup and it's location
return 1;
}
That way, you can save yourself a lot of code when you do this:
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
switch(policepickup[])
{
case 0:
{
//
}
case 1:
{
//
}
case 2:
{
//
}
}
return 1;
}
Just saves space, time, effort and processing power when you are using multiple pickups.