SA-MP Forums Archive
ranks ofr my gamemode - 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: ranks ofr my gamemode (/showthread.php?tid=388985)



ranks ofr my gamemode - Mustafa6155 - 31.10.2012

i got an bf3 server please help
new i need an dialog i have but i need like this
https://sampwiki.blast.hk/wiki/OnDialogResponse'
but i dont know how to make
and it will go to all ranks please help

Код:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 110) //i just entered id 110
    {
        if(response) // If they clicked 'Yes' or pressed enter
        {
            //checks player score
            //gives him the weapons
        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }
 
    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}

Код:
//Classes
#define SNIPER_CLASS 1 //you need score 10
#define SOLDIER_CLASS 2 //this one 0
#define PYROMAN_CLASS 3 // 350
#define SPY_CLASS 4 //250
#define GUNNER_CLASS 5 //10000
#define MEDIC_CLASS 7 //0
#define ENGINEER_CLASS 8// 540
Код:
CMD:classes(playerid, params[])
{
ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Classes", "Soldier\nMedic\nSpy\nGunner\nPyroman\nSniper\nEngineer\nPilot", "Ok", "");
SendClientMessage(playerid, RED, "-------------------------------");
SendClientMessage(playerid, GREEN, "This are the classes");
SendClientMessage(playerid, GREEN, "Soldier");
SendClientMessage(playerid, GREEN, "Medic");
SendClientMessage(playerid, GREEN, "Spy");
SendClientMessage(playerid, GREEN, "Gunner");
SendClientMessage(playerid, GREEN, "Pyroman");
SendClientMessage(playerid, GREEN, "Sniper");
SendClientMessage(playerid, GREEN, "Engineer");
SendClientMessage(playerid, RED, "-------------------------------");
return 1;
}
Please help me guys


Re: ranks ofr my gamemode - [NYO] Kael - 31.10.2012

u mean this?
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 110 && response ==1) //i just entered id 110
    {
        switch(listem)
        {
            case:0
            {
                //SNIPER_CLASS
            }
            case:1
            {
                //SOLDIER_CLASS
            }
            case:2
            {
                //PYROMAN_CLASS
            }
            case:3
            {
                //SPY_CLASS
            }
            case:4
            {
                //GUNNER_CLASS
            }
            case:5
            {
                //MEDIC_CLASS
            }
            case:6
            {
                //ENGINEER_CLASS
            }
        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }
    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
EDIT: You must change the dialog id from the command to 110


Re: ranks ofr my gamemode - Mustafa6155 - 31.10.2012

I got this is this good no the weapons and more it will give an soldier an minigun and also
Quote:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 100)
{
if(response) // If they clicked 'Select' or double-clicked a weapon
{
// Give them the weapon
if(listitem == 0) // They selected the first item - Desert Eagle
{
if (GetPlayerScore(playerid) >= 10)
GivePlayerWeapon(playerid, 23, 500); // Give them a silenced pistol
GivePlayerWeapon(playerid, 34, 375); // Give them a Sniper
GivePlayerWeapon(playerid, 16, 3); // Give them a Garanade
}
else
{
SendClientMessage(playerid, -1,"euhh... u need 10 score for this rank??!@#");
}
if(listitem == 1) // They selected the second item - AK-47
{
if (GetPlayerScore(playerid) >= 0)
GivePlayerWeapon(playerid, 31, 600); // Give them an AK-47
GivePlayerWeapon(playerid, 16, 1); // Give Them an Garanade
GivePlayerWeapon(playerid, 24, 200); // Give them an Desert
}
else
{
SendClientMessage(playerid, -1,"Here U choosed the Soldier class, here u get u Weapons.");
}
if(listitem == 2) // They selected the third item - Desert Eagle
{
if (GetPlayerScore(playerid) >= 350)
GivePlayerWeapon(playerid, 29, 550); // Give them a SMG
GivePlayerWeapon(playerid, 37, 350); // Give them a Flame
GivePlayerWeapon(playerid, 24, 400); // Give them a Combat Shotgun
}
else
{
SendClientMessage(playerid, -1,"You need 350 score for this class!@#!");

}
if(listitem == 3) // They selected the third item - Desert Eagle
{
if (GetPlayerScore(playerid) >= 250)
GivePlayerWeapon(playerid, 23, 450); // Give them a SMG
GivePlayerWeapon(playerid, 4, 1); // Give them a Flame
GivePlayerWeapon(playerid, 39, 3); // Give them a Combat Shotgun
}
else
{
SendClientMessage(playerid, -1,"You need 250 score for this class!@#!");

}
if(listitem == 4) // They selected the third item - Desert Eagle
{
if (GetPlayerScore(playerid) >= 5000)
GivePlayerWeapon(playerid, 38, 1000); // Give them a SMG
GivePlayerWeapon(playerid, 16, 2); // Give them a Flame
GivePlayerWeapon(playerid, 31, 500); // Give them a Combat Shotgun
}
else
{
SendClientMessage(playerid, -1,"You need 5000 score for this class!@#!");

}
if(listitem == 5) // They selected the third item - Desert Eagle
{
if (GetPlayerScore(playerid) >= 0)
GivePlayerWeapon(playerid, 31, 450); // Give them a SMG
GivePlayerWeapon(playerid, 46, 1); // Give them a Flame
GivePlayerWeapon(playerid, 33, 700); // Give them a Combat Shotgun
}
else
{
SendClientMessage(playerid, -1,"Here U choosed the Soldier class, here u get u Weapons.");

}
if(listitem == 6) // They selected the third item - Desert Eagle
{
if (GetPlayerScore(playerid) >= 50)
GivePlayerWeapon(playerid, 31, 450); // Give them a SMG
GivePlayerWeapon(playerid, 9, 1); // Give them a Flame
GivePlayerWeapon(playerid, 23, 540); // Give them a Combat Shotgun
}
else
{
SendClientMessage(playerid, -1,"You need 50 score for this class!@#!");

}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}

return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}




Re: ranks ofr my gamemode - Mustafa6155 - 31.10.2012

please help??


Re: ranks ofr my gamemode - [HK]Ryder[AN] - 31.10.2012

he posted the code a bit wrong..see this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 110 && response ==1) //i just entered id 110
    {
        switch(listem)
        {
            case 0:
            {
                //SOLDIER_CLASS
            }
            case 1:
            {
                //MEDIC_CLASS
            }
            case 2:
            {
                //SPY_CLASS
            }
            case 3:
            {
                //GUNNER_CLASS
            }
            case 4:
            {
                //PYRO_CLASS
            }
            case 5:
            {
                //SNIPER_CLASS
            }
            case 6:
            {
                //ENGI_CLASS
            }
            case 7:
            {
               //PILOT CLASS
             }
        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }
    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}



Re: ranks ofr my gamemode - Mustafa6155 - 31.10.2012

i fixed But only one this he dont do getplayerscore??

Quote:
Quote:
Quote:

case 0:
{
//SNIPER_CLASS anybody can choose this one??
if (GetPlayerScore(playerid) >= 10)
GivePlayerWeapon(playerid, 23, 500); // Give them a silenced pistol
GivePlayerWeapon(playerid, 34, 375); // Give them a Sniper
GivePlayerWeapon(playerid, 16, 3); // Give them a Garanade

}