/*
| |
| Script updated by: Jeffrey_Hatrix, thanks to Willian_Luigi |
| to orginal Cars Machine at pastebin.com/HnBePeCp |
| |
*/
#include <a_samp>
#include <SII>
#include <ZCMD>
#define filterScriptUser
#define callCarsDialog 1
#define msgbox DIALOG_STYLE_MSGBOX
#define input DIALOG_STYLE_INPUT
#define list DIALOG_STYLE_LIST
forward wii_CreateCars(playerid, carro, Float:x_, Float:y_, Float:z_, Float:a_);
forward LOAD_CAR();
new Global[128];
enum DATA_CAR {
file,
u,
id,
c_,
c2_,
Float:x,
Float:y,
Float:z,
Float:a
};
new Approppriately[DATA_CAR];
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case callCarsDialog:
if(response)
{
ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
return 1;
}
case 2:
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 3, input, "Cars GUI","\nType a id of a vehicle to create and save\n\n", "Confirm", "Back");
return 1;
}
else if(listitem == 1)
{
ShowPlayerDialog(playerid, 4, input, "Cars GUI","\nType the id of File to delete the car.\n\n", "Confirm", "Back");
return 1;
}
else if(listitem == 2)
{
ShowPlayerDialog(playerid, 7, list, "Cars GUI - COLORS", "\nColor 1\nColor 2\n\n", "Confirm", "Back");
return 1;
}
else if(listitem == 3)
{
ShowPlayerDialog(playerid, 10, input, "Cars GUI - X", "\nType the id File to teleport.\n\n", "Confirm", "Back");
return 1;
}
else if(listitem == 4)
{
ShowPlayerDialog(playerid, 13, input, "Cars GUI - Spawn", "\nType the id File to respawn\n\n", "Confirm", "Cancel");
return 1;
}
}
case 3:
if(response)
{
if(IsPlayerInAnyVehicle(playerid))
return ShowPlayerDialog(playerid, 2, list, "ERROR, ALREADY IN A VEHICLE", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
GetPlayerPos(playerid, Approppriately[x], Approppriately[y], Approppriately[z]);
GetPlayerFacingAngle(playerid, Approppriately[a]);
new cc_ = strval(inputtext);
SetTimerEx("wii_CreateCars", 5000, false, "ddffff", playerid, cc_, Approppriately[x], Approppriately[y], Approppriately[z], Approppriately[a]);
format(Global, 60, "(WAIT 5 SECONDS) - File car created, id of car: %d", cc_);
ShowPlayerDialog(playerid, 6, msgbox, "Sucessful", Global, "Continue", "Back");
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid, Approppriately[x]+2, Approppriately[y], Approppriately[z]);
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
case 4:
if(response)
{
new cc_ = strval(inputtext);
format(Global, 30, "Cars/%d.ini", cc_);
if(!INI_Exist(Global)) return ShowPlayerDialog(playerid, 5, msgbox, "ERROR", "The id from File car doesn't exist, try again.\n\n", "Try", "Cancel");
INI_Remove(Global);
format(Global, 45, "File car id[%d] deleted with successful!", cc_);
ShowPlayerDialog(playerid, 5, msgbox, "Cars GUI", Global, "Delete other", "Cancel");
DestroyVehicle(cc_);
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
case 5:
if(response)
{
ShowPlayerDialog(playerid, 4, input, "Cars GUI","\nType the ID File for delete the car\n\n", "Confirm", "Back");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
case 6:
if(!response) return ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
case 7:
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 8, input, "COR 1", "\nType the id of File car\n\n", "Confirm", "Cancel");
return 1;
}
else if(listitem == 2)
{
ShowPlayerDialog(playerid, 9, input, "COR 2", "\nType the id of File car\n\n", "Confirm", "Cancel");
return 1;
}
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
case 8:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 2, list, "ERROR, INVALID ID", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
ShowPlayerDialog(playerid, 11, input, "COR 1", "\nType the value of color 1 ( 0 - 128 )\n\n", "Confirm", "Cancel");
return 1;
}
case 9:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 2, list, "ERROR, INVALID ID", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
ShowPlayerDialog(playerid, 12, input, "COR 2", "\nType the value of color 2 ( 0 - 128 )\n\n", "Confirm", "Cancel");
return 1;
}
case 10:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 2, list, "ERROR, INVALID ID", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
PutPlayerInVehicle(playerid, Approppriately[id], 0);
ShowPlayerDialog(playerid, 2, list, "Cars GUI - Teleport successful.", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
case 11:
if(response)
{
if(128 > Approppriately[c_] < 0)
return ShowPlayerDialog(playerid, 2, list, "ERROR, INVALID VALUE", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
Approppriately[c_] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
INI_Open(Global);
INI_WriteInt("Info Cor 1", Approppriately[c_]);
INI_Save();
INI_Close();
ChangeVehicleColor(Approppriately[id], Approppriately[c_], Approppriately[c2_]);
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
case 12:
if(response)
{
if(128 > Approppriately[c2_] < 0)
return ShowPlayerDialog(playerid, 2, list, "ERROR, INVALID VALUE", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
Approppriately[c2_] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
INI_Open(Global);
INI_WriteInt("Info Cor 2", Approppriately[c2_]);
INI_Save();
INI_Close();
ChangeVehicleColor(Approppriately[id], Approppriately[c_], Approppriately[c2_]);
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
case 13:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 2, list, "ERROR, ID INVБLIDO", "\nCriar carro\nDeletar carro\nModificar cores\nIr atй carro \"x\"\nRespawn carro \"x\"\n\n", "Confirm", "Cancel");
SetVehicleToRespawn(Approppriately[id]);
ShowPlayerDialog(playerid, 2, list, "VEНCULO RESPAWNADO", "\nCriar carro\nDeletar carro\nModificar cores\nIr atй carro \"x\"\nRespawn carro \"x\"\n\n", "Confirm", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\n\n", "Confirm", "Cancel");
default: return false;
}
return 1;
}
CMD:carsmachine(playerid) {
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, -1, "You're not an admin Rcon !");
ShowPlayerDialog(playerid, callCarsDialog, msgbox, "Introduction", "[FS] - by Willian_Luigi, updated by: Jeffrey_Hatrix\n\n", "Continue", "");
return 1;
}
/*
CMD:ac(playerid, params[]) {
new id_;
if(sscanf(params, "d", id_))
return SendClientMessage(playerid, -1, "Approppriately Use: /ac [id file]");
format(Global, 20, "Cars/%d.ini", id_);
if(!INI_Exist(Global))
return SendClientMessage(playerid, -1, "ID inexistente");
INI_Remove(Global);
format(Global, 30, "Arquivo carro id %d deletado!", id_);
return 1;
}
CMD:cc(playerid, params[]) {
new car;
if(sscanf(params,"d", car))
return SendClientMessage(playerid, -1, "Approppriately Use: /cc [ID]");
if(IsPlayerInAnyVehicle(playerid)) {
GetVehiclePos(GetPlayerVehicleID(playerid), Approppriately[x], Approppriately[y], Approppriately[z]);
GetVehicleZAngle(GetPlayerVehicleID(playerid), Approppriately[a]);
}
else {
GetPlayerPos(playerid, Approppriately[x], Approppriately[y], Approppriately[z]);
GetPlayerFacingAngle(playerid, Approppriately[a]);
}
if(611 > car > 400)
return (SetTimerEx("wii_CreateCars", 5000, false, "ddffff",playerid, car, Approppriately[x], Approppriately[y], Approppriately[z], Approppriately[a]));
SendClientMessage(playerid, -1, "Carro criado com sucesso.");
return 1;
}*/
public wii_CreateCars(playerid, carro, Float:x_, Float:y_, Float:z_, Float:a_) {
TogglePlayerControllable(playerid, 1);
Approppriately[file] ++;
Approppriately[c_] = random(128);
Approppriately[c2_] = random(128);
new ff = CreateVehicle(carro, x_, y_, z_, a_, Approppriately[c_], Approppriately[c2_], 9999999);
PutPlayerInVehicle(playerid, ff , 0);
format(Global, 30, "Cars/%d.ini", Approppriately[file]);
INI_Open(Global);
INI_WriteInt("Info Car ID", carro);
INI_WriteInt("Info Car ID GAME", Approppriately[file]);
INI_WriteFloat("Info Float x", Approppriately[x]);
INI_WriteFloat("Info Float y", Approppriately[y]);
INI_WriteFloat("Info Float z", Approppriately[z]);
INI_WriteFloat("Info Angle", Approppriately[a]);
INI_WriteInt("Info Cor 1", Approppriately[c_]);
INI_WriteInt("Info Cor 2", Approppriately[c2_]);
INI_Save();
INI_Close();
strdel(Global, 0, 128);
INI_Open("Carros/MaxVehicles");
INI_WriteInt("Veiculos Criados", Approppriately[file]);
INI_Save();
INI_Close();
return 1;
}
public LOAD_CAR() {
INI_Open("Cars/MaxVehicles");
Approppriately[id] = INI_ReadInt("Veiculos Criados");
new n = 1;
while(n != -1) {
format(Global, 30, "Cars/%d.ini", n);
if(!fexist(Global)) break;
INI_Open(Global);
Approppriately[id] = INI_ReadInt("Info Car ID GAME");
Approppriately[u] = INI_ReadInt("Info Car ID");
Approppriately[x] = INI_ReadFloat("Info Float x");
Approppriately[y] = INI_ReadFloat("Info Float y");
Approppriately[z] = INI_ReadFloat("Info Float z");
Approppriately[a] = INI_ReadFloat("Info Angle");
Approppriately[c_] = INI_ReadInt("Info Cor 1");
Approppriately[c2_] = INI_ReadInt("Info Cor 2");
AddStaticVehicleEx(Approppriately[u], Approppriately[x], Approppriately[y], Approppriately[z], Approppriately[a], Approppriately[c_], Approppriately[c2_], 9999999);
n++;
}
return 1;
}
#if defined filterScriptUser
public OnFilterScriptInit() {
LOAD_CAR();
print("\n--------------------------------------\n");
print("FilterScript vehicleCreator.");
print("Atual update 1.0 from Jeffrey_Hatrix, thanks to Willian_Luigi");
printf("Veнculos carregados: %d", Approppriately[id]);
return print("\n--------------------------------------\n");
}
#else
#error Run this like a FilterScript, By:Willian_Luigi
#endif
This spawns vehicles in server and keep them till the Fs is on?
|
Nice work with this. Can i change this according to my needs? Anyways nice release. (Repped+ for the work)
|
Thanks and..
Yep, can you give me tips for a new version too if you want. |
Ohh yeah.
1. Mods Saving. 2. Changing Spawn Position , Model , Color , etc of a car (Rcon Admins Only) |
I'll update this, thanks ! - Mods Saving, Chaging Spawn Position, Model...
Color it's already saving and you can changing too. It's only for rcon admins. |
/*
| |
| Script updated by: Jeffrey_Hatrix, thanks to Willian_Luigi |
| to orginal Cars Machine at pastebin.com/HnBePeCp |
| |
*/
#include <a_samp>
#include <SII>
#include <ZCMD>
#include <sscanf2>
#define filterScriptUser
#define callCarsDialog 1
#define msgbox DIALOG_STYLE_MSGBOX
#define input DIALOG_STYLE_INPUT
#define list DIALOG_STYLE_LIST
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define HOLDING(%0) \
((newkeys & (%0)) == (%0))
forward wii_CreateCars(playerid, carro, Float:x_, Float:y_, Float:z_, Float:a_);
forward LOAD_CAR();
new Global[128];
enum DATA_CAR {
file,
u,
id,
c_,
c2_,
Float:x,
Float:y,
Float:z,
Float:a
};
new Approppriately[DATA_CAR];
static bool:FreeChange[MAX_PLAYERS];
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case callCarsDialog:
if(response)
{
ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
return 1;
}
case 2:
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 3, input, "Cars GUI","\nType a id of a vehicle to create and save\n\n", "Confirm", "Back");
return 1;
}
else if(listitem == 1)
{
ShowPlayerDialog(playerid, 4, input, "Cars GUI","\nType the id of File to delete the car.\n\n", "Confirm", "Back");
return 1;
}
else if(listitem == 2)
{
ShowPlayerDialog(playerid, 7, list, "Cars GUI - COLORS", "\nColor 1\nColor 2\n\n", "Confirm", "Back");
return 1;
}
else if(listitem == 3)
{
ShowPlayerDialog(playerid, 10, input, "Cars GUI - X", "\nType the id File to teleport.\n\n", "Confirm", "Back");
return 1;
}
else if(listitem == 4)
{
ShowPlayerDialog(playerid, 13, input, "Cars GUI - Respawn", "\nType the id File to respawn\n\n", "Confirm", "Cancel");
return 1;
}
else if(listitem == 5)
{
ShowPlayerDialog(playerid, 14, list, "Cars GUI - Spawn Change", "\nFloat x\nFloat y\nFloat z\nFloat angle\nFree change\n\n", "Confirm", "Cancel");
return 1;
}
else if(listitem == 6)
{
ShowPlayerDialog(playerid, 25, input, "Cars GUI - Model", "\nType the id File to change car model\n\n", "Confirm", "Cancel");
return 1;
}
}
case 3:
if(response)
{
if(IsPlayerInAnyVehicle(playerid))
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nYou're already in a vehicle !\n\n", "Continue", "Cancel");
GetPlayerPos(playerid, Approppriately[x], Approppriately[y], Approppriately[z]);
GetPlayerFacingAngle(playerid, Approppriately[a]);
new cc_ = strval(inputtext);
SetTimerEx("wii_CreateCars", 5000, false, "ddffff", playerid, cc_, Approppriately[x], Approppriately[y], Approppriately[z], Approppriately[a]);
format(Global, 60, "(WAIT 5 SECONDS) - File car created, id of car: %d", cc_);
ShowPlayerDialog(playerid, 6, msgbox, "Sucessful", Global, "Continue", "Back");
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid, Approppriately[x]+2, Approppriately[y], Approppriately[z]);
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 4:
if(response)
{
new cc_ = strval(inputtext);
format(Global, 30, "Cars/%d.ini", cc_);
if(!INI_Exist(Global)) return ShowPlayerDialog(playerid, 5, msgbox, "ERROR", "The id from File car doesn't exist, try again.\n\n", "Try", "Cancel");
INI_Remove(Global);
format(Global, 45, "File car id[%d] deleted with successful!", cc_);
ShowPlayerDialog(playerid, 5, msgbox, "Cars GUI", Global, "Delete other", "Cancel");
DestroyVehicle(cc_);
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 5:
if(response)
{
ShowPlayerDialog(playerid, 4, input, "Cars GUI","\nType the ID File for delete the car\n\n", "Confirm", "Back");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 6:
if(!response) return ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 7:
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 8, input, "COR 1", "\nType the id of File car\n\n", "Confirm", "Cancel");
return 1;
}
else if(listitem == 2)
{
ShowPlayerDialog(playerid, 9, input, "COR 2", "\nType the id of File car\n\n", "Confirm", "Cancel");
return 1;
}
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 8:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nInvalid file ID, try again.\n\n", "Continue", "Cancel");
ShowPlayerDialog(playerid, 11, input, "COR 1", "\nType the value of color 1 ( 0 - 128 )\n\n", "Confirm", "Cancel");
return 1;
}
case 9:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nInvalid file ID, try again.\n\n", "Continue", "Cancel");
ShowPlayerDialog(playerid, 12, input, "COR 2", "\nType the value of color 2 ( 0 - 128 )\n\n", "Confirm", "Cancel");
return 1;
}
case 10:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nInvalid file ID, try again.\n\n", "Continue", "Cancel");
PutPlayerInVehicle(playerid, Approppriately[id], 0);
ShowPlayerDialog(playerid, 2, list, "Cars GUI - Teleport successful.", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 11:
if(response)
{
if(128 > Approppriately[c_] < 0)
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nInvalid color value, try again.\n\n", "Continue", "Cancel");
Approppriately[c_] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
INI_Open(Global);
INI_WriteInt("Info Cor 1", Approppriately[c_]);
INI_Save();
INI_Close();
ChangeVehicleColor(Approppriately[id], Approppriately[c_], Approppriately[c2_]);
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 12:
if(response)
{
if(128 > Approppriately[c2_] < 0)
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nInvalid color value, try again.\n\n", "Continue", "Cancel");
Approppriately[c2_] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
INI_Open(Global);
INI_WriteInt("Info Cor 2", Approppriately[c2_]);
INI_Save();
INI_Close();
ChangeVehicleColor(Approppriately[id], Approppriately[c_], Approppriately[c2_]);
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 13:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nInvalid file ID, try again.\n\n", "Continue", "Cancel");
SetVehicleToRespawn(Approppriately[id]);
ShowPlayerDialog(playerid, 2, list, "VEНCULO RESPAWNADO", "\nCriar carro\nDeletar carro\nModificar cores\nIr atй carro \"x\"\nRespawn carro \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 14:
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 15, input, "Spawn Float x", "\nType id file car to change floats\n\n", "Confirm", "Cancel");
return 1;
}
else if(listitem == 1)
{
ShowPlayerDialog(playerid, 17, input, "Spawn Float x", "\nType id file car to change floats\n\n", "Confirm", "Cancel");
return 1;
}
else if(listitem == 2)
{
ShowPlayerDialog(playerid, 19, input, "Spawn Float x", "\nType id file car to change floats\n\n", "Confirm", "Cancel");
return 1;
}
else if(listitem == 3)
{
ShowPlayerDialog(playerid, 21, input, "Spawn Float x", "\nType id file car to change floats\n\n", "Confirm", "Cancel");
return 1;
}
else if(listitem == 4)
{
ShowPlayerDialog(playerid, 23, input, "Spawn Float x", "\nType id file car to change floats\n\n", "Confirm", "Cancel");
return 1;
}
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 15:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nInvalid file ID, try again.\n\n", "Continue", "Cancel");
ShowPlayerDialog(playerid, 16, input, "Spawn Float x", "\nType float value to be spawn X\n\n", "Confirm", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 16:
if(response)
{
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
Approppriately[x] = floatstr(inputtext);
INI_Open(Global);
INI_WriteFloat("Info Float x", Approppriately[x]);
INI_Save();
INI_Close();
ShowPlayerDialog(playerid, 1, msgbox, "Spawn pos set!", "Click OK to continue cars GUI", "Ok", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 17:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nInvalid file ID, try again.\n\n", "Continue", "Cancel");
ShowPlayerDialog(playerid, 18, input, "Spawn Float y", "\nType float value to be spawn Y\n\n", "Confirm", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 18:
if(response)
{
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
Approppriately[y] = floatstr(inputtext);
INI_Open(Global);
INI_WriteFloat("Info Float y", Approppriately[y]);
INI_Save();
INI_Close();
ShowPlayerDialog(playerid, 1, msgbox, "Spawn pos set!", "Click OK to continue cars GUI", "Ok", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 19:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nInvalid file ID, try again.\n\n", "Continue", "Cancel");
ShowPlayerDialog(playerid, 20, input, "Spawn Float z", "\nType float value to be spawn Z\n\n", "Confirm", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 20:
if(response)
{
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
Approppriately[z] = floatstr(inputtext);
INI_Open(Global);
INI_WriteFloat("Info Float z", Approppriately[z]);
INI_Save();
INI_Close();
ShowPlayerDialog(playerid, 1, msgbox, "Spawn pos set!", "Click OK to continue cars GUI", "Ok", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 21:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nInvalid file ID, try again.\n\n", "Continue", "Cancel");
ShowPlayerDialog(playerid, 22, input, "Spawn Float Angle", "\nType float value to be spawn Angle\n\n", "Confirm", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 22:
if(response)
{
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
Approppriately[a] = floatstr(inputtext);
INI_Open(Global);
INI_WriteFloat("Info Angle", Approppriately[a]);
INI_Save();
INI_Close();
ShowPlayerDialog(playerid, 1, msgbox, "Spawn pos set!", "Click OK to continue cars GUI", "Ok", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 23:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nInvalid file ID, try again.\n\n", "Continue", "Cancel");
ShowPlayerDialog(playerid, 24, msgbox, "Spawn Float free change", "\nNow you open free change position,\nuse Q to set x+\nE to set x-\n6 to set y+\n4 to set y-\nAltgr to set Angle+\nCapslock to set Angle-\n\n", "Confirm", "Cancel");
TogglePlayerControllable(playerid, 0);
FreeChange[playerid] = true;
PutPlayerInVehicle(playerid, Approppriately[id], 0);
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 24:
if(response || !response) return false;
case 25:
if(response)
{
Approppriately[id] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
if(!INI_Exist(Global))
return ShowPlayerDialog(playerid, 1, msgbox, "ERROR", "\nInvalid file ID, try again.\n\n", "Continue", "Cancel");
ShowPlayerDialog(playerid, 26, input, "Change model", "\nType model id\n\n","Confirm", "Cancel");
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
case 26:
if(response)
{
Approppriately[u] = strval(inputtext);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
INI_Open(Global);
INI_WriteInt("Info Car ID", Approppriately[u]);
INI_Save();
INI_Close();
GetVehiclePos(Approppriately[id], Approppriately[x], Approppriately[y], Approppriately[z]);
GetVehicleZAngle(Approppriately[id], Approppriately[a]);
DestroyVehicle(Approppriately[id]);
//CreateVehicle(Approppriately[u], Approppriately[x], Approppriately[y], Approppriately[z], Approppriately[a], Approppriately[c_], Approppriately[c2_], 9999999);
CreateVehicle(Approppriately[u], Approppriately[x], Approppriately[y], Approppriately[z], Approppriately[a], -1, -1, 9999999);
return 1;
}
else ShowPlayerDialog(playerid, 2, list, "Cars GUI", "\nCreate car\nDelete car\nChoose colors\nTeleport to car \"x\"\nRespawn car \"x\"\nChange spawn\nChange model\n\n", "Confirm", "Cancel");
default: return false;
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(FreeChange[playerid])
{
GetVehiclePos(Approppriately[id], Approppriately[x], Approppriately[y], Approppriately[z]);
GetVehicleZAngle(Approppriately[id], Approppriately[a]);
if(newkeys == 256)
{
SetVehiclePos(GetPlayerVehicleID(playerid), Approppriately[x]+1, Approppriately[y], Approppriately[z]);
return 1;
}
if(newkeys == 64)
{
SetVehiclePos(GetPlayerVehicleID(playerid), Approppriately[x]-1, Approppriately[y], Approppriately[z]);
return 1;
}
if(newkeys == 16384)
{
SetVehiclePos(GetPlayerVehicleID(playerid), Approppriately[x], Approppriately[y]+1, Approppriately[z]);
return 1;
}
if(newkeys == 8192)
{
SetVehiclePos(GetPlayerVehicleID(playerid), Approppriately[x], Approppriately[y]-1, Approppriately[z]);
return 1;
}
if(newkeys == 128 || HOLDING(128))
{
SetVehicleZAngle(GetPlayerVehicleID(playerid), Approppriately[a]+1);
return 1;
}
if(newkeys == 4 || HOLDING(4))
{
SetVehicleZAngle(GetPlayerVehicleID(playerid), Approppriately[a]-1);
return 1;
}
if(newkeys == 1)
{
GetVehiclePos(Approppriately[id], Approppriately[x], Approppriately[y], Approppriately[z]);
GetVehicleZAngle(Approppriately[id], Approppriately[a]);
format(Global, 30, "Cars/%d.ini", Approppriately[id]);
INI_Open(Global);
INI_WriteFloat("Info Float x", Approppriately[x]);
INI_WriteFloat("Info Float y", Approppriately[y]);
INI_WriteFloat("Info Float z", Approppriately[z]);
INI_WriteFloat("Info Angle", Approppriately[a]);
INI_Save();
INI_Close();
FreeChange[playerid] = false;
format(Global, sizeof(Global), "You has updated your car spawn position to: \nx: %f, \ny: %f, \nz: %f, \nangle: %f", Approppriately[x], Approppriately[y], Approppriately[z], Approppriately[a]);
ShowPlayerDialog(playerid, 20, msgbox, "Free Change", Global, "Ok", "");
TogglePlayerControllable(playerid, 1);
return 1;
}
return 1;
}
return 1;
}
CMD:carsmachine(playerid) {
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, -1, "You're not an admin Rcon !");
ShowPlayerDialog(playerid, callCarsDialog, msgbox, "Introduction", "[FS] - by Willian_Luigi, updated by: Jeffrey_Hatrix\n\n", "Continue", "");
return 1;
}
stock ModifyModel(vehicleid, modelid) {
new Float:x, Float:y, Float:z, Float:a, c1, c2;
GetVehicleZAngle(vehicleid, a);
GetVehiclePos(vehicleid, x, y, z);
CreateVehicle(modelid, x, y, z, a, c1, c2, 9999999);
DestroyVehicle(vehicleid);
return 1;
}
public wii_CreateCars(playerid, carro, Float:x_, Float:y_, Float:z_, Float:a_) {
TogglePlayerControllable(playerid, 1);
Approppriately[file] ++;
Approppriately[c_] = random(128);
Approppriately[c2_] = random(128);
new ff = CreateVehicle(carro, x_, y_, z_, a_, Approppriately[c_], Approppriately[c2_], 9999999);
PutPlayerInVehicle(playerid, ff , 0);
format(Global, 30, "Cars/%d.ini", Approppriately[file]);
INI_Open(Global);
INI_WriteInt("Info Car ID", carro);
INI_WriteInt("Info Car ID GAME", Approppriately[file]);
INI_WriteFloat("Info Float x", Approppriately[x]);
INI_WriteFloat("Info Float y", Approppriately[y]);
INI_WriteFloat("Info Float z", Approppriately[z]);
INI_WriteFloat("Info Angle", Approppriately[a]);
INI_WriteInt("Info Cor 1", Approppriately[c_]);
INI_WriteInt("Info Cor 2", Approppriately[c2_]);
INI_Save();
INI_Close();
strdel(Global, 0, 128);
INI_Open("Carros/MaxVehicles");
INI_WriteInt("Veiculos Criados", Approppriately[file]);
INI_Save();
INI_Close();
return 1;
}
public LOAD_CAR() {
INI_Open("Cars/MaxVehicles");
Approppriately[id] = INI_ReadInt("Veiculos Criados");
new n = 1;
while(n != -1) {
format(Global, 30, "Cars/%d.ini", n);
if(!fexist(Global)) break;
INI_Open(Global);
Approppriately[id] = INI_ReadInt("Info Car ID GAME");
Approppriately[u] = INI_ReadInt("Info Car ID");
Approppriately[x] = INI_ReadFloat("Info Float x");
Approppriately[y] = INI_ReadFloat("Info Float y");
Approppriately[z] = INI_ReadFloat("Info Float z");
Approppriately[a] = INI_ReadFloat("Info Angle");
Approppriately[c_] = INI_ReadInt("Info Cor 1");
Approppriately[c2_] = INI_ReadInt("Info Cor 2");
AddStaticVehicleEx(Approppriately[u], Approppriately[x], Approppriately[y], Approppriately[z], Approppriately[a], Approppriately[c_], Approppriately[c2_], 9999999);
n++;
}
return 1;
}
#if defined filterScriptUser
public OnFilterScriptInit() {
LOAD_CAR();
print("\n--------------------------------------\n");
print("FilterScript vehicleCreator.");
print("Atual update 1.0 from Jeffrey_Hatrix, thanks to Willian_Luigi");
printf("Veнculos carregados: %d", Approppriately[id]);
return print("\n--------------------------------------\n");
}
#else
#error Run this like a FilterScript, By:Willian_Luigi
#endif
Updated, hope you like.
Update: Change spawn, you type float x, y, z, angle or you can choose free change spawn, you press Q move car x+ | E: x- | 6: y+ |4: y- |Altgr: Angle rotation+ | Capslock: Angle rotation- Change vehicle model, this destroy old model and create a new with the same ID game at same position. And I make some updates into interface error, etc... Source: pawn Код:
|
Yeah, good job.
Try to make a new update with: paintjob, components, try to create some system vehicle motor to add to FilterScript with optional mode. Example, admin rcon types "/motorsystem on" | "/motorsystem off" |
Updated, hope you like.
Update: Change spawn, you type float x, y, z, angle or you can choose free change spawn, you press Q move car x+ | E: x- | 6: y+ |4: y- |Altgr: Angle rotation+ | Capslock: Angle rotation- Change vehicle model, this destroy old model and create a new with the same ID game at same position. And I make some updates into interface error, etc... |