Vehicle help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicle help (
/showthread.php?tid=651493)
Vehicle help -
firstlast488 - 21.03.2018
Can you help me to add location of car in the command of vstorage in dialog box?
Код:
CMD:vstorage(playerid, params[])
{
if(AdminDuty[playerid] == 1)
{
SendClientMessage(playerid,COLOR_WHITE, "You can't use this command while on-duty as admin.");
return 1;
}
new vstring[1024];
for(new i, iModelID; i < MAX_PLAYERVEHICLES; i++) {
if((iModelID = PlayerVehicleInfo[playerid][i][pvModelId] - 400) >= 0) {
if(PlayerVehicleInfo[playerid][i][pvImpounded]) {
format(vstring, sizeof(vstring), "%s\n{FFA500}Vehicle:{FFFFFF} %s {FFA500}| Status: {FFFFFF}Impounded", vstring, VehicleName[iModelID]);
}
else if(PlayerVehicleInfo[playerid][i][pvDisabled]) {
format(vstring, sizeof(vstring), "%s\n{FFA500}Vehicle:{FFFFFF} %s {FFA500}| Status: {FFFFFF}Disabled", vstring, VehicleName[iModelID]);
}
else if(!PlayerVehicleInfo[playerid][i][pvSpawned]) {
format(vstring, sizeof(vstring), "%s\n{FFA500}Vehicle:{FFFFFF} %s {FFA500}| Status: {FFFFFF}Stored", vstring, VehicleName[iModelID]);
}
else format(vstring, sizeof(vstring), "%s\n{FFA500}Vehicle:{FFFFFF} %s {FFA500}| Status: {FFFFFF}Spawned", vstring, VehicleName[iModelID]);
}
else strcat(vstring, "\nEmpty");
}
ShowPlayerDialogEx(playerid, VEHICLESTORAGE, DIALOG_STYLE_LIST, "Vehicle storage", vstring, "(De)spawn", "Cancel");
return 1;
}
Re: Vehicle help -
PowerMwK - 21.03.2018
PHP код:
// Put the player's vehicle at the coordinates 0, 0, 3 (center of SA)
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, 0, 0, 3);
//SetVehiclePos(vehicleid, Float:x, Float:y, Float:z);
https://sampwiki.blast.hk/wiki/SetVehiclePos
Re: Vehicle help -
firstlast488 - 21.03.2018
how to add ex. {FFA500}| Location: {FFFFFF}%sJefferson
Код:
if(PlayerVehicleInfo[playerid][i][pvImpounded]) {
format(vstring, sizeof(vstring), "%s\n{FFA500}Vehicle:{FFFFFF} %s {FFA500}| Status: {FFFFFF}Impounded", vstring, VehicleName[iModelID]);
}
Re: Vehicle help -
Hitropl - 21.03.2018
Create the names of the streets with their coordinates, then in your cycle, you will find out which name street