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(127420.00.09.0);//Here goes the coordinates
    
return 1;
}
//:...................//:...................
//:...................
//:...................
//:...................
//:...................
public OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == weapon)
     {
     
ShowPlayerDialog(playeridDIALOG_WEAPONSDIALOG_STYLE_LIST"Weapons""Deagle\nAK47\nShotgspa""Buy""Quit");
    return 
1;
}
//:...................
//:...................
//:...................
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_WEAPONS)
    {
        if(
response
        {
            
            if(
listitem == 0
            {
                
GivePlayerWeapon(playerid29114);
            }
            if(
listitem == 1
            {
                
GivePlayerWeapon(playerid30120);
            }
            if(
listitem == 2)
            {
                
GivePlayerWeapon(playerid27280);
            }
        }
        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 029invalid expressionassumed zero
C
:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1970) : error 035argument type mismatch (argument 6)
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1979) : warning 217loose indentation
C
:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1982) : warning 217loose indentation
C
:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1982) : error 029invalid expressionassumed 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 017undefined symbol "dialogid"
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1986) : error 017undefined symbol "response"
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1989) : error 017undefined symbol "listitem"
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1993) : error 017undefined symbol "listitem"
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1997) : error 017undefined symbol "listitem"
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(2007) : error 030compound statement not closed at the end of file (started at line 1976)
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
10 Errors

Reply
#6

PHP код:
#include <a_samp> 
//:................... 
#define DIALOG_WEAPONS 3 
//:................... 
new weapon
//:................... 
public OnGameModeInit() 

    
weapon CreatePickup(127420.00.09.0);//Here goes the coordinates 
    
return 1

//:...................//:................... 
//:................... 
//:................... 
//:................... 
//:................... 
public OnPlayerPickUpPickup(playeridpickupid

    if(
pickupid == weapon
    { 
     
ShowPlayerDialog(playeridDIALOG_WEAPONSDIALOG_STYLE_LIST"Weapons""Deagle\nAK47\nShotgspa""Buy""Quit");
    }
// The mistake was here the bracket was not closed :)
    
return 1

//:................... 
//:................... 
//:................... 
public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) 

    if(
dialogid == DIALOG_WEAPONS
    { 
        if(
response)  
        { 
             
            if(
listitem == 0)  
            { 
                
GivePlayerWeapon(playerid29114); 
            } 
            if(
listitem == 1)  
            { 
                
GivePlayerWeapon(playerid30120); 
            } 
            if(
listitem == 2
            { 
                
GivePlayerWeapon(playerid27280); 
            } 
        } 
        return 
1;  
    } 
    return 
0;  

Reply
#7

Thanks Dude.. +reputated..
Reply
#8

No Prob Bro
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)