27.01.2015, 10:17
Hello , i am facing some problems while making /park command . I have a pickup in which players can set there vehicle and spawn vehicles . but i want to set /park option . So when player uss /park the vehicle in which he is saved in the house .
Following is the cmd . Please convert it into CMDark.
Following is the cmd . Please convert it into CMDark.
PHP код:
else if(dialogid == HOUSE_DIAG+18) // This is "Set Spawn Vehicle" . This is to set the vehicle for the house .
{
if(!response) return 1;
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, HOUSE_DIAG+18, DIALOG_STYLE_INPUT, "{"#B>"}House Settings - {"#G>"}House Vehicles", "{"#R>"}ERROR: You must enter a vehicle name or model id!\n\n{"#W>"}Enter a vehicle name or model id to continue", "Set", "Cancel");
new vehid = GetVehicleModel2(inputtext);
if(!IsValidVehicle(vehid) || !IsAllowedVehicle(vehid)) return ShowPlayerDialog(playerid, HOUSE_DIAG+18, DIALOG_STYLE_INPUT, "{"#B>"}House Settings - {"#G>"}House Vehicles", "{"#R>"}ERROR: This vehicle is either not allowed or does not exist!\n\n{"#W>"}Enter a vehicle name or model id to continue", "Set", "Cancel");
new key[20];
new houseid = HOUSEID(playerid);
new vehslot = GetPVarInt(playerid, "HVehSlot");
format(hfile, sizeof(hfile), HOUSE_FILE, houseid);
format(key, sizeof(key), "VSlot%dModel", vehslot);
dini_IntSet(hfile, key, vehid);
hVeh[houseid][vehslot][ModelID] = vehid;
NotifyDialog(playerid, "{"#B>"}House Settings - {"#G>"}House Vehicles", "House vehicle model was successfully changed!");
}
else if(dialogid == HOUSE_DIAG+19) // This will spawn player's vehicle.
{
new houseid = HOUSEID(playerid);
if(response)
{
new key[20];
format(hfile, sizeof(hfile), HOUSE_FILE, houseid);
format(key, sizeof(key), "VSlot%dModel", listitem);
if(!dini_Isset(hfile, key)) return NotifyDialog(playerid, "{"#B>"}House Settings - {"#G>"}Spawn House Vehicle", "{"#R>"}ERROR: This vehicle slot is not yet set, make sure to edit it first!");
for(new x=0; x<MAX_VEHICLE_SLOTS; x++) DestroyVehicle(hVeh[houseid][x][Vehicle]);
new vehid = dini_Int(hfile, key);
hVeh[houseid][listitem][Vehicle] = CreateVehicle(vehid, hInfo[houseid][VehPos][0], hInfo[houseid][VehPos][1], hInfo[houseid][VehPos][2], hInfo[houseid][VehPos][3], random(120), random(120), 0);
new str[115];
format(str, sizeof(str), "Vehicle '%s' (Slot %d) was successfully spawned at your house location!", VehicleNames[vehid-400], listitem);
SendClientMessage(playerid, MSG_COLOR, str);
format(str, sizeof(str), "{"#B>"}Vehicle {"#G>"}'%s'\n{"#B>"}of {"#G>"}'Slot %d' {"#B>"}spawned!", VehicleNames[vehid-400], listitem);
CreateHouseNotice3DLabel(houseid, str, MSG_COLOR, hInfo[houseid][VehPos][0], hInfo[houseid][VehPos][1], hInfo[houseid][VehPos][2], 0, -1, -1, 8000);
PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
}