Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:creategarage(playerid,params[])
- {
- if(pInfo[playerid][pAdmin] < 5) return SCM(playerid, -1, "Nu poti vedea comenzile de la acest nivel de admin!");
- new buyprice, IDD, tip;
- if(GetPlayerVehicleID(playerid) != 0) return SendClientMessage(playerid, -1, "You must be on foot to create a garage.");
- for (IDD = 1; IDD < MAX_GARAGES; IDD++)
- if (!IsValidDynamicPickup(GarageInfo[IDD][PickupID]))
- break;
- if (IDD == MAX_GARAGES) return SendClientMessage(playerid, -1, "The maximum amount of garages has been reached.");
- if (!IsValidDynamicPickup(GarageInfo[IDD][PickupID]))
- {
- new Float:x, Float:y, Float:z, Msg[259];
- GetPlayerPos(playerid, x, y, z);
- //edit By Andu
- if(sscanf(params, "ii", tip, buyprice)) return SendClientMessage(playerid, 0xFF0000AA, "Foloseste: /creategaraj <modelid> <pret>");
- if(tip < 1 || tip > 2) return SendClientMessage(playerid, 0xFF0000AA, "Model-ul pot fi de la 1 la 2");
- if(tip == 1)
- {
- //GarageInfo[IDD][Intrarex] = x; GarageInfo[IDD][Intrarey] = y; GarageInfo[IDD][Intrarez] = z; GarageInfo[IDD][] = 0;
- GarageInfo[IDD][Owned] = 0;
- GarageInfo[IDD][Owner][0] = EOS;
- GarageInfo[IDD][eX] = x;
- GarageInfo[IDD][eY] = y;
- GarageInfo[IDD][eZ] = z;
- GarageInfo[IDD][Price] = buyprice;
- GarageInfo[IDD][GarajVirtual] = IDD;
- GarageInfo[IDD][Intrarex] = 2153.9072; //1
- GarageInfo[IDD][Intrarey] = 242.1120; //2
- GarageInfo[IDD][Intrarez] = 997.3860; //3
- OnGarage_Update(IDD);
- mysql_format(MySQLCon, Msg, sizeof(Msg), "INSERT INTO `garages` (IDD , eX , eY, eZ , Owner, Price, GarajVirtual, Intrarex, Intrarey, Intrarez) VALUES (%i , %f , %f, %f , '%e', %i , %i, %f , %f, %f)" , IDD, x, y, z , GarageInfo[IDD][Owner], buyprice,GarageInfo[IDD][GarajVirtual] ,GarageInfo[IDD][Intrarex], GarageInfo[IDD][Intrarey],GarageInfo[IDD][Intrarez]);
- mysql_tquery(MySQLCon, Msg, "","");
- format(Msg, sizeof(Msg), "{00FF00}You've succesfully created a garage with ID: {FFFF00}%i", IDD);
- SendClientMessage(playerid, -1, Msg);
- }
- else if(tip == 2)// mare
- {
- //GarageInfo[IDD][Intrarex] = x; GarageInfo[IDD][Intrarey] = y; GarageInfo[IDD][Intrarez] = z; GarageInfo[IDD][] = 0;
- GarageInfo[IDD][Owned] = 0;
- GarageInfo[IDD][Owner][0] = EOS;
- GarageInfo[IDD][eX] = x;
- GarageInfo[IDD][eY] = y;
- GarageInfo[IDD][eZ] = z;
- GarageInfo[IDD][Price] = buyprice;
- GarageInfo[IDD][GarajVirtual] = IDD;
- GarageInfo[IDD][Intrarex] = 2153.9072; //1
- GarageInfo[IDD][Intrarey] = 242.1120; //2
- GarageInfo[IDD][Intrarez] = 997.3860; //3
- OnGarage_Update(IDD);
- mysql_format(MySQLCon, Msg, sizeof(Msg), "INSERT INTO `garages` (IDD , eX , eY, eZ , Owner, Price, GarajVirtual, Intrarex, Intrarey, Intrarez) VALUES (%i , %f , %f, %f , '%e', %i , %i, %f , %f, %f)" , IDD, x, y, z , GarageInfo[IDD][Owner], buyprice,GarageInfo[IDD][GarajVirtual] ,GarageInfo[IDD][Intrarex], GarageInfo[IDD][Intrarey],GarageInfo[IDD][Intrarez]);
- mysql_tquery(MySQLCon, Msg, "","");
- format(Msg, sizeof(Msg), "{00FF00}You've succesfully created a garage with ID: {FFFF00}%i", IDD);
- SendClientMessage(playerid, -1, Msg);
- }
- }
- else
- SendClientMessage(playerid, -1, "The maximum amount of garages has been reached");
- return 1;
- }
- CMD:enter(playerid, params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- new GarageID;
- for (GarageID = 1; GarageID < MAX_GARAGES; GarageID++)
- {
- if (IsValidDynamicPickup(GarageInfo[GarageID][PickupID]))
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.5, GarageInfo[GarageID][eX], GarageInfo[GarageID][eY], GarageInfo[GarageID][eZ]))
- {
- if (OnGarage_PlayerIsOwner(playerid, GarageID) == 0) return SendClientMessage(playerid, -1, "You are not the owner of this garage.");
- if(IsPlayerInAnyVehicle(playerid))
- {
- PlayerGarageID[playerid] = GarageInfo[GarageID][GarajVirtual];
- SetVehiclePos(vehicleid, GarageInfo[GarageID][Iesirex], GarageInfo[GarageID][Iesirey], GarageInfo[GarageID][Iesirez]);
- SetVehicleVirtualWorld(vehicleid, GarageInfo[GarageID][GarajVirtual]); SetPlayerVirtualWorld(playerid, GarageInfo[GarageID][GarajVirtual]);
- return 1;
- }
- else
- {
- PlayerGarageID[playerid] = GarageInfo[GarageID][GarajVirtual];
- SetPlayerPos(playerid, GarageInfo[GarageID][Iesirex], GarageInfo[GarageID][Iesirey], GarageInfo[GarageID][Iesirez]);
- SetPlayerVirtualWorld(playerid, GarageInfo[GarageID][GarajVirtual]);
- return 1;
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment