18.12.2014, 05:09
Hey this is a code from the CnR script for the vehicle shop, can anyone help me in adding more vehicles
Код:
if(dialogid == NVM_MENU) { if(response) switch(listitem) { case 0://Sports Cars { ShowPlayerDialog(playerid, NVM_CARS, DIALOG_STYLE_LIST, "{FFFFFF}New Vegas Motors - Sports Cars", "{FFFFFF}Vehicle: Infernus - Price: $2M\nVehicle: Bullet - Price: $2M\nVehicle: Comet - Price: $2M\nVehicle: Banshee - Price: $1M\nVehicle: Super-GT - Price: $1M\nVehicle: Sultan - Price: $800K\nVehicle: Cheetah - Price: $5M\nVehicle: Turismo - Price: $5M\nVehicle: Stretch - Price: $8M\nVehicle: Hotknife - Price: $6M\nVehicle: Blade - Price: $2M\nVehicle: Elegy - Price: $800K", "Buy", "Cancel"); return 1; } case 1://More Sports Cars { ShowPlayerDialog(playerid, NVM_MORE, DIALOG_STYLE_LIST, "{FFFFFF}New Vegas Motors - More Sports Cars", "{FFFFFF}Vehicle: Jester - Price: $2M\nVehicle: Slamvan - Price: $5M\nVehicle: Uranus - Price: $2M", "Buy", "Cancel"); return 1; } case 2://Motor Bikes { ShowPlayerDialog(playerid, NVM_BIKES, DIALOG_STYLE_LIST, "{FFFFFF}New Vegas Motors - Motor Bikes", "{FFFFFF}Vehicle: NRG-500 - Price: $2M\nVehicle: FCR-900 - Price: $1M\nVehicle: PCJ-600 - Price: $800K\nVehicle: FreeWay - Price: $4M\nVehicle: BMX - Price: $20K\nVehicle: Sanchez - Price: $500K", "Buy", "Cancel"); return 1; } case 3://Special Vehicles { ShowPlayerDialog(playerid, NVM_SPEC, DIALOG_STYLE_LIST, "{FFFFFF}New Vegas Motors - Special Vehicles", "{FFFFFF}Vehicle: Maverick - Price: $5M\nVehicle: Vortex - Price: $3M\nVehicle: Monster Truck - Price: $2M\nVehicle: Bandito - Price: $1M\nVehicle: Quad Bike - Price: $500K", "Buy", "Cancel"); } } return 1; } if(dialogid == NVM_CARS) { if(response) switch(listitem) { case 0://Infernus { if(GetPlayerCash(playerid) < 2000000) return SendClientMessage(playerid, RED, "Insufficient funds."); if(PlayerInfo[playerid][vLevel] >= 1)//VIP { if(GetPlayerVehicles{playerid} >= MAX_VIP_VEHS) { new string[150]; format(string, sizeof(string), "You already own a maximum of %d vehicles, delete/sell one before buying another.", MAX_VIP_VEHS); SendClientMessage(playerid, RED, string); return 1; } CreateNewPlayerVehicle(playerid, 411, 2000000); SendClientMessage(playerid, WHITE, "You have successfully purchased a Infernus for $2M."); return 1; } if(PlayerInfo[playerid][vLevel] < 1 && DegreeInfo[playerid][dDealer] >= 1)//Degree { if(GetPlayerVehicles{playerid} >= MAX_DEGREE_VEHS) { new string[150]; format(string, sizeof(string), "You already own a maximum of %d vehicles, delete/sell one before buying another.", MAX_DEGREE_VEHS); SendClientMessage(playerid, RED, string); return 1; } CreateNewPlayerVehicle(playerid, 411, 2000000); SendClientMessage(playerid, WHITE, "You have successfully purchased a Infernus for $2M."); return 1; } if(PlayerInfo[playerid][vLevel] < 1 && DegreeInfo[playerid][dDealer] < 1)//Player { if(GetPlayerVehicles{playerid} >= MAX_BUYABLE_VEHS) { new string[150]; format(string, sizeof(string), "You already own a maximum of %d vehicles, delete/sell one before buying another.", MAX_BUYABLE_VEHS); SendClientMessage(playerid, RED, string); return 1; } CreateNewPlayerVehicle(playerid, 411, 2000000); SendClientMessage(playerid, WHITE, "You have successfully purchased a Infernus for $2M."); } } case 1://Bullet { if(GetPlayerCash(playerid) < 2000000) return SendClientMessage(playerid, RED, "Insufficient funds."); if(PlayerInfo[playerid][vLevel] >= 1)//VIP { if(GetPlayerVehicles{playerid} >= MAX_VIP_VEHS) { new string[150]; format(string, sizeof(string), "You already own a maximum of %d vehicles, delete/sell one before buying another.", MAX_VIP_VEHS); SendClientMessage(playerid, RED, string); return 1; } CreateNewPlayerVehicle(playerid, 541, 2000000); SendClientMessage(playerid, WHITE, "You have successfully purchased a Bullet for $2M."); return 1; } if(PlayerInfo[playerid][vLevel] < 1 && DegreeInfo[playerid][dDealer] >= 1)//Degree { if(GetPlayerVehicles{playerid} >= MAX_DEGREE_VEHS) { new string[150]; format(string, sizeof(string), "You already own a maximum of %d vehicles, delete/sell one before buying another.", MAX_DEGREE_VEHS); SendClientMessage(playerid, RED, string); return 1; } CreateNewPlayerVehicle(playerid, 541, 2000000); SendClientMessage(playerid, WHITE, "You have successfully purchased a Bullet for $2M."); return 1; } if(PlayerInfo[playerid][vLevel] < 1 && DegreeInfo[playerid][dDealer] < 1)//Player { if(GetPlayerVehicles{playerid} >= MAX_BUYABLE_VEHS) { new string[150]; format(string, sizeof(string), "You already own a maximum of %d vehicles, delete/sell one before buying another.", MAX_BUYABLE_VEHS); SendClientMessage(playerid, RED, string); return 1; } CreateNewPlayerVehicle(playerid, 541, 2000000); SendClientMessage(playerid, WHITE, "You have successfully purchased a Bullet for $2M."); } }