Help me with Weapon Dialog REP++
#1

Hello i need help with this see video http://www.youtube.com/watch?v=qI7rf...ature=********* if player Connnected and spwned Show dialog and Select weapon and if he spawned again dont show more Dialog.
Reply
#2

pawn Код:
//top
new Spawned[MAX_PLAYERS];

//OnPlayerSpawn
if(Spawned[playerid] == 0)
{
    Spawned[playerid] = 1;
    ShowPlayerDialog(....);
}
Something like this!
Reply
#3

Thanks for this but how t make for give and weapon what weapon i Select?
Reply
#4

OnDialogResponse
ShowPlayerDialog

From using my Filterscript, you can just use the following code:

PHP код:
#include <a_samp>
/*         Weapons Dialog
                by
            Private200          */
//=======================[Colors]====================
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_RED 0xAA3333AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_VIOLET 0x9955DEEE
#define COLOR_LIGHTRED 0xFF99AADD
#define COLOR_SEAGREEN 0x00EEADDF
#define COLOR_GRAYWHITE 0xEEEEFFC4
#define COLOR_LIGHTNEUTRALBLUE 0xabcdef66
#define COLOR_GREENISHGOLD 0xCCFFDD56
#define COLOR_LIGHTBLUEGREEN 0x0FFDD349
#define COLOR_NEUTRALBLUE 0xABCDEF01
#define COLOR_LIGHTCYAN 0xAAFFCC33
#define COLOR_LEMON 0xDDDD2357
#define COLOR_MEDIUMBLUE 0x63AFF00A
#define COLOR_NEUTRAL 0xABCDEF97
#define COLOR_BLACK 0x00000000
#define COLOR_NEUTRALGREEN 0x81CFAB00
#define COLOR_DARKGREEN 0x12900BBF
#define COLOR_LIGHTGREEN 0x24FF0AB9
#define COLOR_DARKBLUE 0x300FFAAB
#define COLOR_BLUEGREEN 0x46BBAA00
#define COLOR_PINK 0xFF66FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PURPLE 0x800080AA
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_RED1 0xFF0000AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BROWN 0x993300AA
#define COLOR_CYAN 0x99FFFFAA
#define COLOR_TAN 0xFFFFCCAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_KHAKI 0x999900AA
#define COLOR_LIME 0x99FF00AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD1 0xB4B5B7FF
//=======================[End of Colors]======================
#define DIALOG_WEAPONS 1337
public OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Weapons FS by Private200");
    print(
"--------------------------------------\n");
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
ShowPlayerDialog(playeridDIALOG_WEAPONSDIALOG_STYLE_LIST"What type of weapon do you want?""Melee Weapons \nPistols\nShotguns\nSub-Machine Guns\nRifles\nJetpack\nCamera\nMinigun""Search""Cancel");
        return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_WEAPONS)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
ShowPlayerDialog(playeridDIALOG_WEAPONS+1DIALOG_STYLE_LIST"Chose your melee weapon:""Brass Knuckles \nGolf Club\nKnife\nBaseball bat\nChainsaw""Get""Cancel");
            }
            if(
listitem == 1)
            {
                
ShowPlayerDialog(playeridDIALOG_WEAPONS+2DIALOG_STYLE_LIST"Chose your pistol:""9MM \nSilenced 9mm\nDesert Eagle""Get""Cancel");
            }
            if(
listitem == 2)    // The third item listed
            
{
                
ShowPlayerDialog(playeridDIALOG_WEAPONS+3DIALOG_STYLE_LIST"Chose your pistol:""Shotgun \nSawnoff Shotgun\nCombat Shotgun""Get""Cancel");
            }
            if(
listitem == 3)    //The third item listed
            
{
                
ShowPlayerDialog(playeridDIALOG_WEAPONS+4DIALOG_STYLE_LIST"Chose your pistol:""Micro UZI \nMP5\nAK-47\nM4\nTec-9""Get""Cancel");
            }
            if(
listitem == 4//The fourth item listed
            
{
                
ShowPlayerDialog(playeridDIALOG_WEAPONS+5DIALOG_STYLE_LIST"Chose your pistol:""Country Rifle \nSniper Rifle""Get""Cancel");
            }
            if(
listitem == 5//The fourth item listed
            
{
                
SetPlayerSpecialAction(playerid,2);
            }
            if(
listitem == 6//The fourth item listed
            
{
                
GivePlayerWeapon(playerid4350000);
            }
            if(
listitem == 7//The fourth item listed
            
{
                
GivePlayerWeapon(playerid3850000);
            }
        }
        return 
1;
    }
    if(
dialogid == DIALOG_WEAPONS+1)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid15);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid22);
            }
            if(
listitem == 2)
            {
                
GivePlayerWeapon(playerid42);
            }
            if(
listitem == 3)
            {
                
GivePlayerWeapon(playerid52);
            }
            if(
listitem == 4)
            {
                
GivePlayerWeapon(playerid92);
            }
        }
        return 
1;
    }
    if(
dialogid == DIALOG_WEAPONS+2)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid2250000);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid2350000);
            }
            if(
listitem == 2)
            {
                
GivePlayerWeapon(playerid2450000);
            }
        }
        return 
1;
    }
    if(
dialogid == DIALOG_WEAPONS+3)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid2550000);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid2650000);
            }
            if(
listitem == 2)
            {
                
GivePlayerWeapon(playerid2750000);
            }
        }
        return 
1;
    }
    if(
dialogid == DIALOG_WEAPONS+4)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid2850000);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid2950000);
            }
            if(
listitem == 2)
            {
                
GivePlayerWeapon(playerid3050000);
            }
            if(
listitem == 3)
            {
                
GivePlayerWeapon(playerid3150000);
            }
            if(
listitem == 4)
            {
                
GivePlayerWeapon(playerid3250000);
            }
        }
        return 
1;
    }
    if(
dialogid == DIALOG_WEAPONS+5)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid3350000);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid3450000);
            }
        }
        return 
1;
    }
    return 
0;
 } 
This shall work fine.
Reply
#5

I know this but if player spawned show again dialog but i dont need to show more dialog
Reply
#6

Okay, you mean show dialog only 1 time at first spawn? If yes, then you have to use something like this:

PHP код:
// Top of script

new WeaponDialogs[MAX_PLAYERS];

public 
OnPlayerConnect(playerid)
{
     
WeaponDialogs[playerid] = 1;
     return 
1;
}

public 
OnPlayerSpawn(playerid)
{
     if(
WeaponDialogs[playerid] == 1)
     {
    
ShowPlayerDialog(playeridDIALOG_WEAPONSDIALOG_STYLE_LIST"What type of weapon do you want?""Melee Weapons \nPistols\nShotguns\nSub-Machine Guns\nRifles\nJetpack\nCamera\nMinigun""Search""Cancel"); 
     
WeaponDialogs[playerid] = 0;
     }
     return 
1;

I think this is what you're asking for and it shall work fine.
Reply
#7

I do this but if player spawned dont send me weapon what i Check Frist understand me?
Reply
#8

PHP код:
#include <a_samp> 

/*         Weapons Dialog 
                by 
            Private200          */ 

//=======================[Colors]==================== 
#define COLOR_LIGHTBLUE 0x33CCFFAA 
#define COLOR_RED 0xAA3333AA 
#define COLOR_GREY 0xAFAFAFAA 
#define COLOR_YELLOW 0xFFFF00AA 
#define COLOR_PINK 0xFF66FFAA 
#define COLOR_BLUE 0x0000BBAA 
#define COLOR_WHITE 0xFFFFFFAA 
#define COLOR_DARKRED 0x660000AA 
#define COLOR_ORANGE 0xFF9900AA 
#define COLOR_BRIGHTRED 0xFF0000AA 
#define COLOR_INDIGO 0x4B00B0AA 
#define COLOR_VIOLET 0x9955DEEE 
#define COLOR_LIGHTRED 0xFF99AADD 
#define COLOR_SEAGREEN 0x00EEADDF 
#define COLOR_GRAYWHITE 0xEEEEFFC4 
#define COLOR_LIGHTNEUTRALBLUE 0xabcdef66 
#define COLOR_GREENISHGOLD 0xCCFFDD56 
#define COLOR_LIGHTBLUEGREEN 0x0FFDD349 
#define COLOR_NEUTRALBLUE 0xABCDEF01 
#define COLOR_LIGHTCYAN 0xAAFFCC33 
#define COLOR_LEMON 0xDDDD2357 
#define COLOR_MEDIUMBLUE 0x63AFF00A 
#define COLOR_NEUTRAL 0xABCDEF97 
#define COLOR_BLACK 0x00000000 
#define COLOR_NEUTRALGREEN 0x81CFAB00 
#define COLOR_DARKGREEN 0x12900BBF 
#define COLOR_LIGHTGREEN 0x24FF0AB9 
#define COLOR_DARKBLUE 0x300FFAAB 
#define COLOR_BLUEGREEN 0x46BBAA00 
#define COLOR_PINK 0xFF66FFAA 
#define COLOR_LIGHTBLUE 0x33CCFFAA 
#define COLOR_DARKRED 0x660000AA 
#define COLOR_ORANGE 0xFF9900AA 
#define COLOR_PURPLE 0x800080AA 
#define COLOR_GRAD1 0xB4B5B7FF 
#define COLOR_GRAD2 0xBFC0C2FF 
#define COLOR_RED1 0xFF0000AA 
#define COLOR_GREY 0xAFAFAFAA 
#define COLOR_GREEN 0x33AA33AA 
#define COLOR_RED 0xAA3333AA 
#define COLOR_YELLOW 0xFFFF00AA 
#define COLOR_WHITE 0xFFFFFFAA 
#define COLOR_BROWN 0x993300AA 
#define COLOR_CYAN 0x99FFFFAA 
#define COLOR_TAN 0xFFFFCCAA 
#define COLOR_PINK 0xFF66FFAA 
#define COLOR_KHAKI 0x999900AA 
#define COLOR_LIME 0x99FF00AA 
#define COLOR_SYSTEM 0xEFEFF7AA 
#define COLOR_GRAD2 0xBFC0C2FF 
#define COLOR_GRAD4 0xD8D8D8FF 
#define COLOR_GRAD6 0xF0F0F0FF 
#define COLOR_GRAD2 0xBFC0C2FF 
#define COLOR_GRAD3 0xCBCCCEFF 
#define COLOR_GRAD5 0xE3E3E3FF 
#define COLOR_GRAD1 0xB4B5B7FF 
//=======================[End of Colors]====================== 

#define DIALOG_WEAPONS 5986

public OnFilterScriptInit() 

    print(
"\n--------------------------------------"); 
    print(
" Weapons FS by Private200"); 
    print(
"--------------------------------------\n"); 
    return 
1


public 
OnPlayerConnect(playerid)
{
     
WeaponDialogs[playerid] = 1;
     return 
1;
}

public 
OnPlayerSpawn(playerid)
{
     if(
WeaponDialogs[playerid] == 1)
     {
     
ShowPlayerDialog(playeridDIALOG_WEAPONSDIALOG_STYLE_LIST"What type of weapon do you want?""Melee Weapons \nPistols\nShotguns\nSub-Machine Guns\nRifles\nJetpack\nCamera\nMinigun""Search""Cancel"); 
     
WeaponDialogs[playerid] = 0;
     }
     return 
1;
}  

public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[]) 

    if(
dialogid == DIALOG_WEAPONS
    { 
        if(
response
        { 
            if(
listitem == 0
            { 
                
ShowPlayerDialog(playeridDIALOG_WEAPONS+1DIALOG_STYLE_LIST"Chose your melee weapon:""Brass Knuckles \nGolf Club\nKnife\nBaseball bat\nChainsaw""Get""Cancel"); 
            } 
            if(
listitem == 1
            { 
                
ShowPlayerDialog(playeridDIALOG_WEAPONS+2DIALOG_STYLE_LIST"Chose your pistol:""9MM \nSilenced 9mm\nDesert Eagle""Get""Cancel"); 
            } 
            if(
listitem == 2)    // The third item listed 
            

                
ShowPlayerDialog(playeridDIALOG_WEAPONS+3DIALOG_STYLE_LIST"Chose your pistol:""Shotgun \nSawnoff Shotgun\nCombat Shotgun""Get""Cancel"); 
            } 
            if(
listitem == 3)    //The third item listed 
            

                
ShowPlayerDialog(playeridDIALOG_WEAPONS+4DIALOG_STYLE_LIST"Chose your pistol:""Micro UZI \nMP5\nAK-47\nM4\nTec-9""Get""Cancel"); 
            } 
            if(
listitem == 4//The fourth item listed 
            

                
ShowPlayerDialog(playeridDIALOG_WEAPONS+5DIALOG_STYLE_LIST"Chose your pistol:""Country Rifle \nSniper Rifle""Get""Cancel"); 
            } 
            if(
listitem == 5//The fourth item listed 
            

                
SetPlayerSpecialAction(playerid,2); 
            } 
            if(
listitem == 6//The fourth item listed 
            

                
GivePlayerWeapon(playerid4350000); 
            } 
            if(
listitem == 7//The fourth item listed 
            

                
GivePlayerWeapon(playerid3850000); 
            } 
        } 
        return 
1
    } 

    if(
dialogid == DIALOG_WEAPONS+1
    { 
        if(
response
        { 
            if(
listitem == 0
            { 
                
GivePlayerWeapon(playerid15); 
            } 
            if(
listitem == 1
            { 
                
GivePlayerWeapon(playerid22); 
            } 
            if(
listitem == 2
            { 
                
GivePlayerWeapon(playerid42); 
            } 
            if(
listitem == 3
            { 
                
GivePlayerWeapon(playerid52); 
            } 
            if(
listitem == 4
            { 
                
GivePlayerWeapon(playerid92); 
            } 
        } 
        return 
1
    } 
    if(
dialogid == DIALOG_WEAPONS+2
    { 
        if(
response
        { 
            if(
listitem == 0
            { 
                
GivePlayerWeapon(playerid2250000); 
            } 
            if(
listitem == 1
            { 
                
GivePlayerWeapon(playerid2350000); 
            } 
            if(
listitem == 2
            { 
                
GivePlayerWeapon(playerid2450000); 
            } 
        } 
        return 
1
    } 
    if(
dialogid == DIALOG_WEAPONS+3
    { 
        if(
response
        { 
            if(
listitem == 0
            { 
                
GivePlayerWeapon(playerid2550000); 
            } 
            if(
listitem == 1
            { 
                
GivePlayerWeapon(playerid2650000); 
            } 
            if(
listitem == 2
            { 
                
GivePlayerWeapon(playerid2750000); 
            } 
        } 
        return 
1
    } 
    if(
dialogid == DIALOG_WEAPONS+4
    { 
        if(
response
        { 
            if(
listitem == 0
            { 
                
GivePlayerWeapon(playerid2850000); 
            } 
            if(
listitem == 1
            { 
                
GivePlayerWeapon(playerid2950000); 
            } 
            if(
listitem == 2
            { 
                
GivePlayerWeapon(playerid3050000); 
            } 
            if(
listitem == 3
            { 
                
GivePlayerWeapon(playerid3150000); 
            } 
            if(
listitem == 4
            { 
                
GivePlayerWeapon(playerid3250000); 
            } 
        } 
        return 
1
    } 
    if(
dialogid == DIALOG_WEAPONS+5
    { 
        if(
response
        { 
            if(
listitem == 0
            { 
                
GivePlayerWeapon(playerid3350000); 
            } 
            if(
listitem == 1
            { 
                
GivePlayerWeapon(playerid3450000); 
            } 
        } 
        return 
1
    } 
I ain't sure if this is what you want, but I think, it's okay.
Reply
#9

ok thanks but its not this what i want but thanks for your time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)