Making /park cmd
#1

Hello , i have a dialog option . When player stand on pickup a dialog appears . And he can set any vehicle in his house . But i want to have a function that player can only save the vehicle in which he is . Following is the code of setting any vehicle to house . How to convert it to a function that he can save only that vehicle in which he is by /park.
PHP Code:
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!"); 
Reply


Messages In This Thread
Making /park cmd - by Arxalan - 28.01.2015, 06:50
Respuesta: Making /park cmd - by Trevor Gin - 28.01.2015, 07:36
Re: Making /park cmd - by Arxalan - 28.01.2015, 08:25

Forum Jump:


Users browsing this thread: 2 Guest(s)