Making a command
#1

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.
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(playeridHOUSE_DIAG+18DIALOG_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(playeridHOUSE_DIAG+18DIALOG_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(hfilesizeof(hfile), HOUSE_FILEhouseid);
                
format(keysizeof(key), "VSlot%dModel"vehslot);
                
dini_IntSet(hfilekeyvehid);
                
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(hfilesizeof(hfile), HOUSE_FILEhouseid);
                        
format(keysizeof(key), "VSlot%dModel"listitem);
                        if(!
dini_Isset(hfilekey)) 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=0x<MAX_VEHICLE_SLOTSx++) DestroyVehicle(hVeh[houseid][x][Vehicle]);
                    new 
vehid dini_Int(hfilekey);
                
hVeh[houseid][listitem][Vehicle] = CreateVehicle(vehidhInfo[houseid][VehPos][0], hInfo[houseid][VehPos][1], hInfo[houseid][VehPos][2], hInfo[houseid][VehPos][3], random(120), random(120), 0);
                        new 
str[115];
                        
format(strsizeof(str), "Vehicle '%s' (Slot %d) was successfully spawned at your house location!"VehicleNames[vehid-400], listitem);
                        
SendClientMessage(playeridMSG_COLORstr);
                        
format(strsizeof(str), "{"#B>"}Vehicle {"#G>"}'%s'\n{"#B>"}of {"#G>"}'Slot %d' {"#B>"}spawned!", VehicleNames[vehid-400], listitem);
                        
CreateHouseNotice3DLabel(houseidstrMSG_COLORhInfo[houseid][VehPos][0], hInfo[houseid][VehPos][1], hInfo[houseid][VehPos][2], 0, -1, -18000);
                        
PlayerPlaySound(playerid10540.00.00.0);
                } 
Reply


Messages In This Thread
Making a command - by Arxalan - 27.01.2015, 10:17
Re: Making a command - by Razturach - 27.01.2015, 10:47
Re: Making a command - by Arxalan - 27.01.2015, 11:04

Forum Jump:


Users browsing this thread: 1 Guest(s)