Pickup with weapon shop [HELP]
#1

Hey Guys..

I just need to add a pickup, and when a player goes through it, it should show a weapon dialogue, and asks the player to buy ...

I would be very glad indeed if you help me out .. !! i tried but i get many errors which confused me !
Reply
#2

http://codegenerators.pl/shopdialog

Simple as that.
Reply
#3

I just need it when i go through a pickup only .. i dont need it as a command !
Reply
#4

PHP код:
#include <a_samp>
//:...................
#define DIALOG_WEAPONS 3
//:...................
new weapon;
//:...................
public OnGameModeInit()
{
    
weapon = CreatePickup(1274, 2, 0.0, 0.0, 9.0);//Here goes the coordinates
    
return 1;
}
//:...................//:...................
//:...................
//:...................
//:...................
//:...................
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(
pickupid == weapon)
     {
     
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "Deagle\nAK47\nShotgspa", "Buy", "Quit");
    return 
1;
}
//:...................
//:...................
//:...................
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(
dialogid == DIALOG_WEAPONS)
    {
        if(
response) 
        {
            
            if(
listitem == 0) 
            {
                
GivePlayerWeapon(playerid, 29, 114);
            }
            if(
listitem == 1) 
            {
                
GivePlayerWeapon(playerid, 30, 120);
            }
            if(
listitem == 2)
            {
                
GivePlayerWeapon(playerid, 27, 280);
            }
        }
        return 
1; 
    }
    return 
0; 
} 
Reply
#5

I did as same as yew... and got these errors !

PHP код:
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1970) : error 029: invalid expression, assumed zero
C
:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1970) : error 035: argument type mismatch (argument 6)
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1979) : warning 217: loose indentation
C
:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1982) : warning 217: loose indentation
C
:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1982) : error 029: invalid expression, assumed zero
C
:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1982) : error 004: function "OnDialogResponse" is not implemented
C
:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1984) : error 017: undefined symbol "dialogid"
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1986) : error 017: undefined symbol "response"
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1989) : error 017: undefined symbol "listitem"
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1993) : error 017: undefined symbol "listitem"
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1997) : error 017: undefined symbol "listitem"
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(2007) : error 030: compound statement not closed at the end of file (started at line 1976)
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase
10 Errors
. 
Reply
#6

PHP код:
#include <a_samp> 
//:................... 
#define DIALOG_WEAPONS 3 
//:................... 
new weapon; 
//:................... 
public OnGameModeInit() 
{ 
    
weapon = CreatePickup(1274, 2, 0.0, 0.0, 9.0);//Here goes the coordinates 
    
return 1; 
} 
//:...................//:................... 
//:................... 
//:................... 
//:................... 
//:................... 
public OnPlayerPickUpPickup(playerid, pickupid) 
{ 
    if(
pickupid == weapon) 
    { 
     
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "Deagle\nAK47\nShotgspa", "Buy", "Quit");
    }
// The mistake was here the bracket was not closed :)
    
return 1; 
} 
//:................... 
//:................... 
//:................... 
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) 
{ 
    if(
dialogid == DIALOG_WEAPONS) 
    { 
        if(
response)  
        { 
             
            if(
listitem == 0)  
            { 
                
GivePlayerWeapon(playerid, 29, 114); 
            } 
            if(
listitem == 1)  
            { 
                
GivePlayerWeapon(playerid, 30, 120); 
            } 
            if(
listitem == 2) 
            { 
                
GivePlayerWeapon(playerid, 27, 280); 
            } 
        } 
        return 
1;  
    } 
    return 
0;  
} 
Reply
#7

Thanks Dude.. +reputated..
Reply
#8

No Prob Bro
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)