Open dialog once walked over pickup
#1

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;
Reply
#2

At least tell us what are the coordinates
Reply
#3

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;
    }
}
Reply
#4

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"
Reply
#5

Cause its "OnPlayerPickPickup" .
Reply
#6

Tried that, same result
Reply
#7

Actually without the Return 1; it works, but with it, it says "Function must return a value"
Reply
#8

PHP код:
#include <a_samp>
#define MAIN 1
new briefcase;
public 
OnGameModeInit()
{
//.................
    
briefcase CreatePickup(121021503.33591432.358510.1191, -1);//The coordinates
    //...........
    
return 1;
}
//.................
//.................
public OnPlayerPickUpPickup(playeridpickupid)
{
if(
pickupid == briefcase)
    {
        
ShowPlayerDialog(playeridMAINDIALOG_STYLE_LIST"{FFFF00}Weapon Store","{F0F0F0}Weapons\n{00FFFF}Else""Ok""Close");
        return 
1;
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)