PDA

View Full Version : What's Wrong With this Weapon Dialog


Eminem 2ka9
09/08/2012, 07:56 PM
When I spawn it shows but I don't get the weapons when I choose any class from the list.

//====================================Made By Naruto_Emilio===================================== ==========//

#include < a_samp >

#include < zcmd >

#define SNIPER_CLASS 1

#define AIRMAN_CLASS 2

#define FLAMETHROWER_CLASS 3

#define ASSAULT_CLASS 4

#define ENGINEER_CLASS 5

#define COLOR_WHITE 0xFFFFFFFF

#define COL_GREEN "{6EF83C}"

#define COL_WHITE "{FFFFFF}"

#define COLOR_RED 0xAA3333AA

#define COLOR_GREEN 0x33AA33AA

//======================CLASSES FUNCTIONS=====================//
new gPlayerClass[MAX_PLAYERS];

public OnPlayerRequestClass(playerid, classid)

{

gPlayerClass[playerid] = ASSAULT_CLASS;

return 1;

}

new PickedClass[MAX_PLAYERS] = 0;


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{

if(GetPlayerScore(playerid) <= 0)//Private
{

SetPlayerSkin(playerid, 287);
SendClientMessage(playerid, COLOR_WHITE, "You chose the assault as your class.");
SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
gPlayerClass[playerid] = ASSAULT_CLASS;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
GivePlayerWeapon(playerid, 24, 200);
GivePlayerWeapon(playerid, 31, 500);
GivePlayerWeapon(playerid, 17, 5);
}
}


if(listitem == 1)//sniper DONE
{
if(GetPlayerScore(playerid) <= 10)//Private

{

SetPlayerSkin(playerid, 122);
SendClientMessage(playerid, COLOR_WHITE, "You chose the Sniper as your class.");
SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
gPlayerClass[playerid] = SNIPER_CLASS;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
GivePlayerWeapon(playerid, 23, 500);
GivePlayerWeapon(playerid, 34, 100);
GivePlayerWeapon(playerid, 29, 200);

}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Private class [/rank to see yours]");
TogglePlayerControllable(playerid, 0);
}
}


if(listitem == 2)//pilot DONE
{
if(GetPlayerScore(playerid) <= 1150)//Lieutenant Colonel

{

SetPlayerSkin(playerid, 61);
SendClientMessage(playerid, COLOR_WHITE, "You chose the Pilot as your class.");
SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
gPlayerClass[playerid] = AIRMAN_CLASS;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
GivePlayerWeapon(playerid, 22, 50);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 16, 5);

}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Lieutenant Colonel class [/rank to see yours]");
TogglePlayerControllable(playerid, 0);
}
}
if(listitem == 3)//Engineer
{
if(GetPlayerScore(playerid) <= 250)//Sergeant

{
SetPlayerSkin(playerid, 285);
SendClientMessage(playerid, COLOR_WHITE, "You chose the Engineer as your class.");
SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
gPlayerClass[playerid] = ENGINEER_CLASS;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
GivePlayerWeapon(playerid, 22, 100);
GivePlayerWeapon(playerid, 32, 500);
GivePlayerWeapon(playerid, 35, 5);


}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Sergeant class [/rank to see yours]");
TogglePlayerControllable(playerid, 0);
}
}

if(listitem == 4)//FlameThrower
{
if(GetPlayerScore(playerid) <= 400)//CAPTAIN

{

SetPlayerSkin(playerid, 144);
SendClientMessage(playerid, COLOR_WHITE, "You chose the Flamethrower as your class.");
SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
gPlayerClass[playerid] = FLAMETHROWER_CLASS;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
GivePlayerWeapon(playerid, 24, 200);
GivePlayerWeapon(playerid, 30, 200);
GivePlayerWeapon(playerid, 37, 200);


}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Captain class [/rank to see yours]");
TogglePlayerControllable(playerid, 0);
}
}
return 1;
}
return 1;
}




//==============================================Do Not Touch============================================= ========//
public OnPlayerRequestSpawn(playerid)
{

ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Classes", "Assault\nSniper\nPilot\nEngineer\nPyroman", "Select", "Cancel");

return 1;

}
//====================================Made By Naruto_Emilio===================================== ==========//

Jstylezzz
09/08/2012, 08:00 PM
what is wrong with it?
i mean, what is your problem with it when using it?
that makes helping alot easier :)

Eminem 2ka9
09/08/2012, 08:01 PM
Kk I posted whats wrong withit

Eminem 2ka9
09/08/2012, 08:03 PM
Oh its fine I fixed it :)