16.06.2012, 00:16
He Guys?
I have This:
====> it appears on every spawn after die. i don't want this. i want it will appear once when we connect to server. And then appear by use using CMD. Not on every spawn even after death...
I have This:
pawn Код:
public OnPlayerSpawn(playerid)
{
ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class (Need No Rank) \nSniper Class (Need Rank 2) \nEngineer Class (Need Rank 3) \nJet-Trooper Class (Need Rank 5) \nPilot Class (Need Rank 7) ", "Choose","");
TogglePlayerControllable(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 999)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerScore(playerid) >= 0)
{
SendClientMessage(playerid, COLOR_WHITE, "Server News: You Chose the Assault as your class.");
ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Assult Class:", "{F81414}Abilities:\n{FFFFFF}A Solo class, good in infantry attacks.\n\n{F81414}Weapons:\n\n{FFFFFF}Knife\n{FFFFFF}M4\n{FFFFFF}Spaz12\n{FFFFFF}Deagle", "OK","");
gPlayerClass[playerid] = ASSAULT;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 27, 400);
GivePlayerWeapon(playerid, 24, 300);
GivePlayerWeapon(playerid, 31, 600);
}
}
if(listitem == 1)
{
if(GetPlayerScore(playerid) >= 300)
{
SendClientMessage(playerid, COLOR_WHITE, "Server News: You Chose the Sniper as your class.");
ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Sniper Class:", "{F81414}Abilities:\n{FFFFFF}A Locater class, Always invisible on map.\n\n{F81414}Weapons:\n\n{FFFFFF}Sniper Rifle\n{FFFFFF}Mp5\n{FFFFFF}Knife\n{FFFFFF}Shotgun", "OK","");
gPlayerClass[playerid] = SNIPER;
PickedClass[playerid] = 1;
SetPlayerColor(playerid,0xFF000000);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 34, 500);
GivePlayerWeapon(playerid, 29, 400);
GivePlayerWeapon(playerid, 25, 500);
}
else
{
SendClientMessage(playerid,COLOR_RED,"You need to be on Rank 3 to get this Class.");
ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class (Need No Rank) \nSniper Class (Need Rank 3) \nEngineer Class (Need Rank 5) \nJet-Trooper Class (Need Rank 7) \nPilot Class (Need Rank 8)", "Choose","");
TogglePlayerControllable(playerid, 0);
}
}
if(listitem == 2)
{
if(GetPlayerScore(playerid) >= 600)
{
SendClientMessage(playerid, COLOR_WHITE, "Server News: You Chose the Engineer as your class.");
ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Engineer Class:", "{F81414}Abilities:\n{FFFFFF}A Strong class. Very good on land\nCan drive tanks.\n\n{F81414}Weapons:\n\n{FFFFFF}Spas12\n{FFFFFF}Silent Pistol\n{FFFFFF}RPG\n{FFFFFF}Desert Eagle", "OK","");
gPlayerClass[playerid] = ENGINEER;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
GivePlayerWeapon(playerid, 27, 400);
GivePlayerWeapon(playerid, 23, 400);
GivePlayerWeapon(playerid, 35, 2);
GivePlayerWeapon(playerid, 24, 150);
}
else
{
SendClientMessage(playerid,COLOR_DARKRED,"You need to be on Rank 5 to get this Class.");
ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class (Need No Rank) \nSniper Class (Need Rank 3) \nEngineer Class (Need Rank 5) \nJet-Trooper Class (Need Rank 7) \nPilot Class (Need Rank 8)", "Choose","");
TogglePlayerControllable(playerid, 0);
}
}
if(listitem == 3)
{
if(GetPlayerScore(playerid) >= 1200)
{
SendClientMessage(playerid, COLOR_WHITE, "Server News: You Chose the Jet-Trooper as your class.");
ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Jetrooper Class:", "{F81414}Abilities:\n{FFFFFF}A Solo class, can spawn jetpack by /jp.\n\n{F81414}Weapons:\n\n{FFFFFF}Tec-9\n{FFFFFF}Colt\n{FFFFFF}Knife\n{FFFFFF}Moltov", "OK","");
gPlayerClass[playerid] = JETTROOPER;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 32, 1000);
GivePlayerWeapon(playerid, 22, 1000);
GivePlayerWeapon(playerid, 18, 2);
}
else
{
SendClientMessage(playerid,COLOR_DARKRED,"You need to be on Rank 7 to get this Class.");
ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class (Need No Rank) \nSniper Class (Need Rank 3) \nEngineer Class (Need Rank 5) \nJet-Trooper Class (Need Rank 7) \nPilot Class (Need Rank 8)", "Choose","");
TogglePlayerControllable(playerid, 0);
}
}
if(listitem == 4)
{
if(GetPlayerScore(playerid) >= 2000)
{
SendClientMessage(playerid, COLOR_WHITE, "Server News: You Chose the Pilot as your class.");
ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Pilot Class:", "{F81414}Abilities:\n{FFFFFF}A Airforce class, Very Good in Air. Can drive Hunter, Hydra & Sea Sparrow.\n\n{F81414}Weapons:\n\n{FFFFFF}Deagle\n{FFFFFF}Tear Gas\n{FFFFFF}Shotgun\n{FFFFFF}9mm", "OK","");
gPlayerClass[playerid] = PILOT;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
GivePlayerWeapon(playerid, 22, 250);
GivePlayerWeapon(playerid, 24, 400);
GivePlayerWeapon(playerid, 17, 4);
GivePlayerWeapon(playerid, 25, 100);
}
else
{
SendClientMessage(playerid,COLOR_DARKRED,"You need to be on Rank 8 to get this Class.");
ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class (Need No Rank) \nSniper Class (Need Rank 3) \nEngineer Class (Need Rank 5) \nJet-Trooper Class (Need Rank 7) \nPilot Class (Need Rank 8)", "Choose","");
TogglePlayerControllable(playerid, 0);
}
}
return 1;
}
return 1;
}
return true;
}
====> it appears on every spawn after die. i don't want this. i want it will appear once when we connect to server. And then appear by use using CMD. Not on every spawn even after death...