public OnDialogsResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
if(GetPlayerScore(playerid) <= 0)//Private
{
SetPlayerSkin(playerid, 287);
SendClientMessage(playerid, COLOR_BLUE, "You chose the assault as your class.");
SendClientMessage(playerid, COLOR_BLUE, "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_BLUE, "You chose the Sniper as your class.");
SendClientMessage(playerid, COLOR_BLUE, "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_RED, "You need to be atleast Private class [/rank to see yours]");
TogglePlayerControllable(playerid, 0);
}
}
if(listitem == 3)//Engineer
{
if(GetPlayerScore(playerid) <= 250)//Sergeant
{
SetPlayerSkin(playerid, 285);
SendClientMessage(playerid, COLOR_BLUE, "You chose the Engineer as your class.");
SendClientMessage(playerid, COLOR_BLUE, "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_RED, "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_BLUE, "You chose the Jet Trooper as your class.");
SendClientMessage(playerid, COLOR_BLUE, "You can type /switchclass to change your class again.");
gPlayerClass[playerid] = JETTROOPER_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_RED, "You need to be atleast Captain class [/rank to see yours]");
TogglePlayerControllable(playerid, 0);
}
}
return 1;
}
return 1;
}
D:\UDC Wars\gamemodes\Wars.pwn(1402) : warning 235: public function lacks forward declaration (symbol "OnDialogsResponse")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
public OnDialogsResponse(playerid, dialogid, response, listitem, inputtext[])
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
if(dialogid == 1)
{
if(response)
{
if(GetPlayerScore(playerid) <= 0)//Private
{
SetPlayerSkin(playerid, 287);
SendClientMessage(playerid, COLOR_BLUE, "You chose the assault as your class.");
SendClientMessage(playerid, COLOR_BLUE, "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_BLUE, "You chose the Sniper as your class.");
SendClientMessage(playerid, COLOR_BLUE, "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_RED, "You need to be atleast Private class [/rank to see yours]");
TogglePlayerControllable(playerid, 0);
}
}
if(listitem == 3)//Engineer
{
if(GetPlayerScore(playerid) <= 250)//Sergeant
{
SetPlayerSkin(playerid, 285);
SendClientMessage(playerid, COLOR_BLUE, "You chose the Engineer as your class.");
SendClientMessage(playerid, COLOR_BLUE, "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_RED, "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_BLUE, "You chose the Jet Trooper as your class.");
SendClientMessage(playerid, COLOR_BLUE, "You can type /switchclass to change your class again.");
gPlayerClass[playerid] = JETTROOPER_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_RED, "You need to be atleast Captain class [/rank to see yours]");
TogglePlayerControllable(playerid, 0);
}
}
return 1;
}
if(gTeam[playerid]!=TEAM_PILOT) { SendClientMessage(playerid,COLOR_RED,"Only pilots can fly in a plane!"); return 1; }
stock ShowPlayerMarkerForPilot(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) == 1) {
if(gTeam[playerid] == TEAM_PILOT) {
if(gTeam[i] == TEAM_PILOT) return SetPlayerMarkerForPlayer(i, playerid, GetPlayerColor(playerid));
}
}
}
}
Thnx soo much. Rep added.
Brother one more thing i want when player gets sniper class than he will invisible on map and when he get pilot than he can driver planes.... How can i? |