• Страница 1 из 1
  • 1
Модератор форума: [east_side]_trane, drifter-dron, valych, admin  
Форум » Pawno » уроки скрипты » Cars Machine v1.0 (*icon-0*)
Cars Machine v1.0
adminДата: Суббота, 24.03.2012, 12:10:06 | Сообщение # 1

Группа: Администраторы
Сообщений: 3869

Code
/*
|                    |
|   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


zm-jail.ru

Разработка сайта samp-pawno.ru


 
Сообщение
Code
/*
|                    |
|   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

Автор - admin
Дата добавления - 24.03.2012 в 12:10:06
Форум » Pawno » уроки скрипты » Cars Machine v1.0 (*icon-0*)
  • Страница 1 из 1
  • 1
Поиск:
Загрузка страницы, займет меньше минуты...
Загрузка...

Статистика Форума
Последнии темы Читаемые темы Лучшие пользователи Новые пользователи
Система телефонов поломалась
Не в себе
фильм скалайн
Трансформеры 3
форсаж 6
Ищу [FS]Для админок на сервер
нужны координаты карты для отметки зон...
Помогите найти мод
pawno урок автоматические ворота
обращение к скриптерам.
Вопросы по скриптингу
Ваши ошибки при компиляции GM/FS

Вопросы по скриптингу

(1081)

Считаем до 1000

(274)

Ваши ошибки при компиляция gm

(260)

Набор в команду

(80)

Ваши ошибки при компиляции GM/FS

(71)

вопроосы по скриптингу от 22.04.2013

(64)

Баннеробмен

(64)

несколько команд на samp 0.3 c

(64)

Оценки сайта samp-pawno.ru

(55)

Заказ хостинга

(51)

Набор в команду(форум)

(45)

Урок №61 по созданию системы авто для GodFather

(45)

admin

(3869)

[east_side]_trane

(443)

TWiX

(316)

valych

(501)

drifter-dron

(477)

danik_rok

(317)

Dimka_71rus

(360)

Drifter96

(300)

MaNb9K

(220)

[MTA]MaPeR5518

(181)

Dima_Tkach

(107)

Nik_Ull

(184)

system32xzxz

(Четверг 09:25:24)

torbin169

(Суббота 23:09:29)

kuchuk_00

(Суббота 17:10:14)

artem_boyko_3

(Суббота 15:57:37)

greggelbak

(Среда 18:29:37)

vladisvlavs

(Среда 13:51:57)

add02102002

(Понедельник 22:37:15)

Диман221

(Понедельник 18:12:45)

almas051004

(Воскресенье 11:05:32)

megasuccessms

(Суббота 14:15:36)

nawe

(Пятница 22:25:23)

swoysb

(Пятница 14:55:29)

Вверх
15:09:48
ОбновитьСмайлыУправление мини-чатом
ЧАТ-PAWNO
2010-2024

vkontakte :samp-pawno.ru: