24.05.2016, 15:45
Hello, I have create a dialog with a few licenses you can get but there is a problem..
The screenshot you see now:
that are the licenses you can get, but if you look inside the chat it says a complete different message.
Here is the dialog:
And here the the command:
As you can see in the CMD the names are the same as the cases in the dialog but if I try to buy the weapon license I don't get anything..
The screenshot you see now:
that are the licenses you can get, but if you look inside the chat it says a complete different message.
Here is the dialog:
PHP код:
if(dialogid == DIALOG_LICENSE_BUY && response)
{
switch (listitem)
{
case 0:
{
if(PlayerInfo[playerid][pIdCard] == 0)
{
if(GetPlayerCash(playerid) < 5000)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can not afford to buy a passport.");
return 1;
}
GivePlayerCash(playerid,-5000);
PlayerInfo[playerid][pIdCard] = 1;
SendClientMessageEx(playerid, COLOR_GREY, "You have successfully acquired a passport.");
}
else SendClientMessageEx(playerid, COLOR_GREY, "You already have a passport.");
}
case 1:
{
if(PlayerInfo[playerid][pCarLic] == 0)
{
if(GetPlayerCash(playerid) < 5000)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can not afford to buy a driving's license.");
return 1;
}
GivePlayerCash(playerid,-5000);
PlayerInfo[playerid][pCarLic] = 1;
SendClientMessageEx(playerid, COLOR_GREY, "You have successfully acquired a driving's license.");
}
else SendClientMessageEx(playerid, COLOR_GREY, "You already have a driving's license.");
}
case 2:
{
if(PlayerInfo[playerid][pFlyLic] == 0)
{
if(PlayerInfo[playerid][pLevel] >=2)
{
if(GetPlayerCash(playerid) < 25000)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can not afford to buy a pilot's license.");
return 1;
}
GivePlayerCash(playerid,-25000);
PlayerInfo[playerid][pFlyLic] = 1;
SendClientMessageEx(playerid, COLOR_GREY, "You have successfully acquired a pilot license; you will now be able to pilot aircraft.");
}
else SendClientMessageEx(playerid, COLOR_GREY, "You must be level 2 or above to acquire a pilot license.");
}
else SendClientMessageEx(playerid, COLOR_GREY, "You already have a pilot license.");
}
case 3:
{
if(PlayerInfo[playerid][pTaxiLicense] == 0)
{
if(GetPlayerCash(playerid) < 35000)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can not afford to buy a taxi license.");
return 1;
}
GivePlayerCash(playerid,-35000);
PlayerInfo[playerid][pTaxiLicense] = 1;
SendClientMessageEx(playerid, COLOR_GREY, "You have successfully acquired a taxi license; you will be able to use /fare in any vehicle, and accept calls for taxis.");
}
else SendClientMessageEx(playerid, COLOR_GREY, "You already have a taxi license.");
}
case 4:
{
if(PlayerInfo[playerid][pBoatLic] == 0)
{
if(GetPlayerCash(playerid) < 15000)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can not afford to buy a boating.");
return 1;
}
GivePlayerCash(playerid,-15000);
PlayerInfo[playerid][pBoatLic] = 1;
SendClientMessageEx(playerid, COLOR_GREY, "You have successfully acquired a boating.");
}
else SendClientMessageEx(playerid, COLOR_GREY, "You already have a boating.");
}
case 5:
{
if(PlayerInfo[playerid][pFishLic] == 0)
{
if(GetPlayerCash(playerid) < 9000)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can not afford to buy a fishing license.");
return 1;
}
GivePlayerCash(playerid,-9000);
PlayerInfo[playerid][pFishLic] = 1;
SendClientMessageEx(playerid, COLOR_GREY, "You have successfully acquired a fishing license.");
}
else SendClientMessageEx(playerid, COLOR_GREY, "You already have a fishing license.");
}
case 6:
{
if(PlayerInfo[playerid][pGunLic] == 0)
{
if(GetPlayerCash(playerid) < 20000)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can not afford to buy a weapon license.");
return 1;
}
GivePlayerCash(playerid,-20000);
PlayerInfo[playerid][pGunLic] = 1;
SendClientMessageEx(playerid, COLOR_GREY, "You have successfully acquired a weapon license.");
}
else SendClientMessageEx(playerid, COLOR_GREY, "You already have a weapon license.");
}
}
}
PHP код:
CMD:getlic(playerid, params[])
{
if (!IsPlayerInRangeOfPoint(playerid,2.0,366.54, 159.09, 1008.38)) { return 1; }
if (PlayerInfo[playerid][pWantedLevel] > 0) return SendClientMessageEx(playerid, COLOR_LIGHTRED, "You have an outstanding arrest warrant - acquisition of a license is prohibited.");
ShowPlayerDialog(playerid, DIALOG_LICENSE_BUY, DIALOG_STYLE_LIST, "Select the type of license you wish to acquire.", "Passport ($5,000)\r\nDriver's License ($5,000)\r\nPilot License ($25,000)\r\nTaxi License ($35,000)\r\nBoating License ($15,000)\r\nFishing License ($9,000)\r\nWeapon License ($20,000)", "Purchase", "Cancel");
return 1;
}