17.04.2012, 09:05
Is there anyway to get it so when I click an option in my dialogue it will run my /duty cmd?
Here is my /duty cmd:
Here is my /duty cmd:
pawn Код:
if(strcmp(cmd, "/duty", true) == 0)
{
if(IsPlayerConnected(playerid)) {
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
if(PlayerInfo[playerid][pMaskUse] == 1) { format(sendername, sizeof(sendername), "[Mask_%d_38]", RandMask[playerid]); }
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 14) {
if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,327.2265,307.9479,999.1484) || PlayerToPoint(3,playerid,233.0675,123.5211,1003.2188)) {
if(OnDuty[playerid]==0) {
format(string, sizeof(string), "* Officer %s took a Badge and a Gun from there locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerWeaponEx(playerid, 24, 250);
GivePlayerWeaponEx(playerid, 25, 300);
GivePlayerWeaponEx(playerid, 3, 0);
GivePlayerWeaponEx(playerid, 41, 1000);
GivePlayerWeaponEx(playerid, 29, 500);
SetPlayerArmourEx(playerid, 100);
SetPlayerHealthEx(playerid, 100);
SetPlayerColor(playerid,TEAM_BLUE_COLOR);
OnDuty[playerid] = 1;
}
else if(OnDuty[playerid]==1) {
format(string, sizeof(string), "* Officer %s places there Badge and Gun in there locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerWeaponEx(playerid, 24, 150);
GivePlayerWeaponEx(playerid, 5, 0);
SetPlayerColor(playerid,TEAM_HIT_COLOR);
OnDuty[playerid] = 0;
}
}
else {
SendClientMessage(playerid, COLOR_GRAD2, " You are not in a locker room !");
return 1;
}
}
else if(PlayerInfo[playerid][pMember] == 2) {
if (PlayerToPoint(3, playerid,196.9520,168.6917,1003.0234) || PlayerToPoint(3,playerid,196.9749,169.9257,1003.0234)) {
if(OnDuty[playerid]==0) {
format(string, sizeof(string), "* Agent %s took a Badge and a Gun from there locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerWeaponEx(playerid, 43, 100);
GivePlayerWeaponEx(playerid, 24, 100);
// GivePlayerWeaponEx(playerid, 3, 1);
SetPlayerArmourEx(playerid, 100);
SetPlayerHealthEx(playerid, 100);
OnDuty[playerid] = 1;
}
else if(OnDuty[playerid]==1) {
format(string, sizeof(string), "* Agent %s places there Badge and Gun in there locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerWeaponEx(playerid, 24, 150);
GivePlayerWeaponEx(playerid, 5, 0);
OnDuty[playerid] = 0;
}
}
else {
SendClientMessage(playerid, COLOR_GRAD2, " You are not in a locker room !");
return 1;
}
}
else if(PlayerInfo[playerid][pMember] == 15) {
if (PlayerToPoint(3, playerid,2743.7537,-2453.8313,13.8623,88.8243) || PlayerToPoint(3,playerid,2743.7537,-2453.8313,13.8623,88.8243)) {
if(OnDuty[playerid]==0) {
format(string, sizeof(string), "* Soldier %s took a Badge and a Gun from there locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerWeaponEx(playerid, 24, 100);
GivePlayerWeaponEx(playerid, 31, 400);
// GivePlayerWeaponEx(playerid, 3, 1);
SetPlayerArmourEx(playerid, 100);
SetPlayerHealthEx(playerid, 100);
SetPlayerColor(playerid, GREEN);
OnDuty[playerid] = 1;
}
else if(OnDuty[playerid]==1) {
format(string, sizeof(string), "* Soldier %s places there Badge and Gun in there locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerWeaponEx(playerid, 24, 150);
GivePlayerWeaponEx(playerid, 5, 0);
OnDuty[playerid] = 0;
}
}
else {
SendClientMessage(playerid, COLOR_GRAD2, " You are not in a locker room !");
return 1;
}
}
else if(PlayerInfo[playerid][pMember] == 3) {
if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,354.3689,173.8600,1008.3828)) {
if(OnDuty[playerid]==0) {
format(string, sizeof(string), "* Bodyguard %s took some guns from the weapons locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerWeaponEx(playerid, 24, 250);
SetPlayerArmourEx(playerid, 100);
SetPlayerHealthEx(playerid, 100);
//SetPlayerColor(playerid,COLOR_LIGHTPURPLE);
OnDuty[playerid] = 1;
}
else if(OnDuty[playerid]==1) {
format(string, sizeof(string), "* Bodyguard %s places there guns in the weapons locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerWeaponEx(playerid, 24, 150);
GivePlayerWeaponEx(playerid, 5, 0);
//SetPlayerColor(playerid,TEAM_HIT_COLOR);
OnDuty[playerid] = 0;
}
}
else {
SendClientMessage(playerid, COLOR_GRAD2, " You are not at the locker!");
return 1;
}
}
else if(PlayerInfo[playerid][pMember] == 4) {
if (PlayerToPoint(100.0, playerid,-3451.3801,475.9214,58.0620)) {
if(OnDuty[playerid] == 1) {
SendClientMessage(playerid, COLOR_GRAD3, "* You are now Off Duty from your Medic Job and will not receive calls anymore.");
OnDuty[playerid] = 0;
}
else {
SendClientMessage(playerid, COLOR_GRAD3, "* You are now On Duty with your Medic Job and will receive calls from people in need.");
GetPlayerName(playerid,sendername,sizeof(sendername));
GiveNameSpace(sendername);
format(string, sizeof(string), "[Advert] Paramedic %s is On Duty, /cell 911.", sendername);
BroadCast(COLOR_ALLDEPT,string);
OnDuty[playerid] = 1;
}
}
else {
SendClientMessage(playerid, COLOR_GRAD2, " You are not at the hospital!");
return 1;
}
}
else if(PlayerInfo[playerid][pMember] == 7) {
if(idcar >= 61 && idcar <= 70) {
if(TaxiDuty[playerid] == 1) {
SendClientMessage(playerid, COLOR_GRAD3, "* You are now Off Duty from your Taxi Job.");
TaxiDuty[playerid] = 0;
}
else {
GetPlayerName(playerid,sendername,sizeof(sendername));
GiveNameSpace(sendername);
format(string, sizeof(string), "Taxi Driver %s is On Duty, /cell 444.", sendername);
BroadCast(0xFF942896,string);
TaxiDuty[playerid] = 1;
}
}
else {
SendClientMessage(playerid, COLOR_GRAD2, " You are not inside a Taxi!");
return 1;
}
}
}
return 1;
}