07.01.2016, 17:04
Hey guys I just scripted a /buyboat command so the way it goes is like this : If you arent near the boat dealership : Server tells you you are not at the right place.
If you are, a dialog box with choices is supposed to appear, but, it doesnt and the /buyboat command simply doesnt pop a thing.
Ok so here is the supposed dialog
And here is the script that calls the dialog
Thanks a lot for you replies, they re all apreciated
If you are, a dialog box with choices is supposed to appear, but, it doesnt and the /buyboat command simply doesnt pop a thing.
Ok so here is the supposed dialog
Код:
else if(dialogid == 440) // Boats { new string[128], carid, price; if(response) { switch(listitem) { case 0: {carid = 446; price = 25000;} case 1: {carid = 452; price = 35000;} case 2: {carid = 453; price = 30000;} case 3: {carid = 454; price = 25000;} case 4: {carid = 472; price = 27000;} case 5: {carid = 473; price = 24000;} case 6: {carid = 484; price = 30000;} case 7: {carid = 493; price = 30000;} } if(price > PlayerInfo[playerid][pMoney]) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money on you."); GiveDodMoney(playerid, -price); format(string, sizeof(string), " You have purchased a %s. (Unlock it using /lock)", RVN(carid)); ++PlayerCars; SendClientMessage(playerid, COLOR_GREEN, string); //if(PlayerInfo[playerid][pVIP] >= 2 && PlayerInfo[playerid][vModel]) if(PlayerInfo[playerid][vModel]) { PlayerInfo[playerid][pVVeh] = CreateVehicle(carid, 826.8421,-2078.9644,-0.1015,87.8349,0,0,1200); SetVehicleParamsEx(PlayerInfo[playerid][pVVeh], 0, 0, 0, 1, 0, 0, 0); PlayerInfo[playerid][vVLocked] = 1; PlayerInfo[playerid][vVModel] = carid; GetVehiclePos(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ]); GetVehicleZAngle(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][vVA]); PlayerInfo[playerid][vVC1] = 0; PlayerInfo[playerid][vVC2] = 0; return 1; } PlayerInfo[playerid][pVeh] = CreateVehicle(carid, 826.8421,-2078.9644,-0.1015,87.8349,0,0,1200); SetVehicleParamsEx(PlayerInfo[playerid][pVeh], 0, 0, 0, 1, 0, 0, 0); PlayerInfo[playerid][vLocked] = 1; PlayerInfo[playerid][vModel] = carid; GetVehiclePos(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ]); GetVehicleZAngle(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vA]); PlayerInfo[playerid][vC1] = 0; PlayerInfo[playerid][vC2] = 0; } }
Код:
CMD:buyboat(playerid, params[]) { new string[128]; if(!IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use command."); if(!IsPlayerInRangeOfPoint(playerid, 5, 830.0919,-2061.3379,12.8672)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the boat dealership."); //if(PlayerInfo[playerid][pVIP] >= 2) //{ if(PlayerInfo[playerid][vModel] && PlayerInfo[playerid][vVModel]) { format(string, sizeof(string), "You already own ID %d and %d.", PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVVeh]); SendClientMessage(playerid, COLOR_GREY, string); return 1; } else ShowDialog(playerid, 440); return 1; /*} if(PlayerInfo[playerid][vModel]) { format(string, sizeof(string), "You already own vehicle ID %d.", PlayerInfo[playerid][pVeh]); SendClientMessage(playerid, COLOR_GREY, string); return 1; } ShowDialog(playerid, 10); return 1;*/ }