12.12.2018, 13:13
i need help to make a cmd /vsearch i maked it but somthing error there vehicle name and quntity does not come help me in making it
this is my command but its have problem it not shows the car name and no. of cars
Quote:
//-----------------------------[ vsearch By Priyanshu]-------------------------- CMD:vsearch(playerid,params[]) { new tmp[128],Index,car; tmp = strtok(params,Index); if(isnull(tmp)) return SendClientMessage(playerid, red, "{00FF00}USAGE: {00FFFF}/vsearch [Vehicle Name/Model]"); //you need zcmd.inc to remove the error - isnull if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp); //if you get error from this line copy the code mentioned below (GetVehicleIDFromName(vname[])) and (isnumeric(string)) if(car < 400 || car > 611) return SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model"); new modelid,tcars,vbuya,vb,vunb,i,msg2[256],msg1[100]; modelid=car; vbuya=0,vb=0,vunb=0; for(i=1;i<=MAX_VEHICLES;i++) { if(GetVehicleModel(i) == modelid) { if(VehicleInfo[i][Temp]==1) continue;//change(Temp) if your gamemode sets temporary vehicles in different way tcars++; if(VehicleInfo[i][buybar]==1)vunb++; else if(VehicleInfo[i][bought]==1)vb++; else if(VehicleInfo[i][bought]==0)vbuya++; } } format(msg2,256,"{FFFFFF}(%d){FFFF00}Free '%s' {FFFFFF}|| (%d){00FF00}Bought '%s' ",vbuya++,vb++); format(msg1,100,"{FFFFFF}Searched Vehicle",VehicleName[modelid-400]); //you must define VehicleName function. If you dont have, i have mentioned below ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, msg1, msg2, "Close", ""); return 1; } |