Open dialog once walked over 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: Open dialog once walked over pickup (
/showthread.php?tid=387267)
Open dialog once walked over pickup -
Eminem 2ka9 - 23.10.2012
I want to make a pickup, the pickup is gonna be a suitcase. When a player walks over it, it will make a dialog appear.
Dialog...
pawn Код:
ShowPlayerDialog(playerid, MAIN, DIALOG_STYLE_LIST, "{FFFF00}Weapon Store", "{F0F0F0}Weapons\n{00FFFF}Else", "Ok", "Close");
return 1;
Re: Open dialog once walked over pickup -
HyDrAtIc - 23.10.2012
At least tell us what are the coordinates
Re: Open dialog once walked over pickup -
Adil - 23.10.2012
pawn Код:
new scasepickup;
scasepickup = CreatePickup(1210.....);
OnPlayerPickupPickup(playerid, pickupid)
{
if(pickupid == scasepickup)
{
ShowPlayerDialog(playerid, MAIN, DIALOG_STYLE_LIST, "{FFFF00}Weapon Store","{F0F0F0}Weapons\n{00FFFF}Else", "Ok", "Close");
return 1;
}
}
Re: Open dialog once walked over pickup -
Eminem 2ka9 - 23.10.2012
Quote:
Originally Posted by Adil
pawn Код:
new scasepickup;
scasepickup = CreatePickup(1210.....);
OnPlayerPickupPickup(playerid, pickupid) { if(pickupid == scasepickup) { ShowPlayerDialog(playerid, MAIN, DIALOG_STYLE_LIST, "{FFFF00}Weapon Store","{F0F0F0}Weapons\n{00FFFF}Else", "Ok", "Close"); return 1; } }
|
Thanks, good answer. It didn't exactly compile correctly, 1 warning appears. Saying "PickupPickup is never used"
Re: Open dialog once walked over pickup -
Dizzle - 23.10.2012
Cause its "OnPlayerPickPickup" .
Re: Open dialog once walked over pickup -
Eminem 2ka9 - 23.10.2012
Tried that, same result
Re: Open dialog once walked over pickup -
Eminem 2ka9 - 23.10.2012
Actually without the Return 1; it works, but with it, it says "Function must return a value"
Re: Open dialog once walked over pickup -
ThePhenix - 23.10.2012
PHP код:
#include <a_samp>
#define MAIN 1
new briefcase;
public OnGameModeInit()
{
//.................
briefcase = CreatePickup(1210, 2, 1503.3359, 1432.3585, 10.1191, -1);//The coordinates
//...........
return 1;
}
//.................
//.................
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == briefcase)
{
ShowPlayerDialog(playerid, MAIN, DIALOG_STYLE_LIST, "{FFFF00}Weapon Store","{F0F0F0}Weapons\n{00FFFF}Else", "Ok", "Close");
return 1;
}
return 1;
}