Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:closeststore(playerid, params[])
- {
- new Float:distance, string[128];
- new StoreID = SpawnedStores;
- distance = GetPlayerDistanceFromPoint(playerid, Player[playerid][sExtX], Player[playerid][sExtY], Player[playerid][sExtZ]);
- switch(SpawnedStores)
- {
- case 1:
- {
- format(string, sizeof(string), "The closest store to you is Store %d (%0.2fm away)", StoreID, distance);
- SendClientMessage(playerid, -1, string);
- }
- case 2:
- {
- format(string, sizeof(string), "The closest store to you is Store %d (%0.2fm away)", StoreID, distance);
- SendClientMessage(playerid, -1, string);
- }
- case 3:
- {
- format(string, sizeof(string), "The closest store to you is Store %d (%0.2fm away)", StoreID, distance);
- SendClientMessage(playerid, -1, string);
- }
- case 4:
- {
- format(string, sizeof(string), "The closest store to you is Store %d (%0.2fm away)", StoreID, distance);
- SendClientMessage(playerid, -1, string);
- }
- case 5:
- {
- format(string, sizeof(string), "The closest store to you is Store %d (%0.2fm away)", StoreID, distance);
- SendClientMessage(playerid, -1, string);
- }
- default:
- {
- SendClientMessage(playerid, WHITE, "No stores created as of yet!");
- }
- }
- return 1;
- }
- CMD:createstore(playerid, params[])
- {
- new StoreID = SpawnedStores+1;
- new string[128];
- if(StoreID >= MAX_SUBSTORES)
- {
- SendClientMessage(playerid, WHITE, "To many stores created.");
- }
- else
- {
- GetPlayerPos(playerid, Player[playerid][sExtX], Player[playerid][sExtY], Player[playerid][sExtZ]);
- format(string, sizeof(string), "You have just created Store %d", StoreID);
- SendClientMessage(playerid, WHITE, string);
- //CreatePickup(1318, 1, Player[playerid][sExtX], Player[playerid][sExtY], Player[playerid][sExtZ]);
- Subway[StoreID][sBusinessExtX] = Player[playerid][sExtID];
- Subway[StoreID][sBusinessExtY] = Player[playerid][sExtID];
- Subway[StoreID][sBusinessExtZ] = Player[playerid][sExtID];
- Subway[StoreID][sStorePickupID] = CreateDynamicPickup(1239, 1, Player[playerid][sExtX], Player[playerid][sExtY], Player[playerid][sExtZ], 0, -1, -1, 150.0);
- SpawnedStores++;
- }
- return 1;
- }
- CMD:ordersub(playerid, params[])
- {
- new Float: X, Float: Y, Float: Z;
- new StoreID = SpawnedStores;
- GetPlayerPos(playerid, X, Y, Z);
- if(StoreID >= 1)
- {
- if(IsPlayerInRangeOfPoint(playerid, 10, Subway[StoreID][sOrderPointX], Subway[StoreID][sOrderPointY], Subway[StoreID][sOrderPointZ]))
- {
- if(Subway[StoreID][OrderMenu] == 1)
- {
- ShowPlayerDialog(playerid, DIALOG_ORDERPOINT, 2, "Subway Menu", "Italian B.M.T\nMeatball Marinara\nChicken Tikka", "Buy", "Rethink");
- }
- else if(Subway[StoreID][OrderMenu] == 2)
- {
- ShowPlayerDialog(playerid, DIALOG_ORDERPOINT, 2, "Subway Menu", "Italian B.M.T\nMeatball Marinara\nChicken Tikka", "Buy", "Rethink");
- }
- else if(Subway[StoreID][OrderMenu] == 3)
- {
- ShowPlayerDialog(playerid, DIALOG_ORDERPOINT, 2, "Subway Menu", "Italian B.M.T\nMeatball Marinara\nChicken Tikka", "Buy", "Rethink");
- }
- else if(Subway[StoreID][OrderMenu] == 4)
- {
- ShowPlayerDialog(playerid, DIALOG_ORDERPOINT, 2, "Subway Menu", "Italian B.M.T\nMeatball Marinara\nChicken Tikka", "Buy", "Rethink");
- }
- else if(Subway[StoreID][OrderMenu] == 5)
- {
- ShowPlayerDialog(playerid, DIALOG_ORDERPOINT, 2, "Subway Menu", "Italian B.M.T\nMeatball Marinara\nChicken Tikka", "Buy", "Rethink");
- }
- else
- {
- SendClientMessage(playerid, -1, "There is no active store!");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "Too far away!");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "There is no active store!");
- }
- return 1;
- }
- CMD:removestore(playerid, params[])
- {
- new string[128];
- new StoreID = SpawnedStores;
- switch(SpawnedStores)
- {
- case 1:
- {
- format(string, sizeof(string), "You have removed Store %d", StoreID);
- SendClientMessage(playerid, -1, string);
- SpawnedStores -= 1;
- FirstOrderPointSet = 0;
- Subway[StoreID][OrderMenu] -= 1;
- DestroyDynamicPickup(Subway[StoreID][sStorePickupID]);
- DestroyDynamicPickup(Subway[StoreID][sStoreOrderPointID]);
- }
- case 2:
- {
- format(string, sizeof(string), "You have removed Store %d", StoreID);
- SendClientMessage(playerid, -1, string);
- SpawnedStores -= 1;
- SecondOrderPointSet = 0;
- Subway[StoreID][OrderMenu] -= 1;
- DestroyDynamicPickup(Subway[StoreID][sStorePickupID]);
- DestroyDynamicPickup(Subway[StoreID][sStoreOrderPointID]);
- }
- case 3:
- {
- format(string, sizeof(string), "You have removed Store %d", StoreID);
- SendClientMessage(playerid, -1, string);
- SpawnedStores -= 1;
- ThirdOrderPointSet = 0;
- DestroyDynamicPickup(Subway[StoreID][sStorePickupID]);
- DestroyDynamicPickup(Subway[StoreID][sStoreOrderPointID]);
- }
- case 4:
- {
- format(string, sizeof(string), "You have removed Store %d", StoreID);
- SendClientMessage(playerid, -1, string);
- SpawnedStores -= 1;
- FourthOrderPointSet = 0;
- DestroyDynamicPickup(Subway[StoreID][sStorePickupID]);
- DestroyDynamicPickup(Subway[StoreID][sStoreOrderPointID]);
- }
- case 5:
- {
- format(string, sizeof(string), "You have removed Store %d", StoreID);
- SendClientMessage(playerid, -1, string);
- SpawnedStores -= 1;
- FifthOrderPointSet = 0;
- DestroyDynamicPickup(Subway[StoreID][sStorePickupID]);
- DestroyDynamicPickup(Subway[StoreID][sStoreOrderPointID]);
- }
- default:
- {
- SendClientMessage(playerid, WHITE, "No stores created as of yet!");
- }
- }
- return 1;
- }
- CMD:createorderpoint(playerid, params[])
- {
- new StoreID = SpawnedStores;
- new id;
- if(sscanf(params, "d", id))
- {
- SendClientMessage(playerid, GREY, "SYNTAX: /createorderpoint [1-5]");
- }
- else
- {
- if(id == 1)
- {
- if(StoreID >= 1)
- {
- if(FirstOrderPointSet == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 10.0, Player[playerid][sExtX], Player[playerid][sExtY], Player[playerid][sExtZ]))
- {
- //Player[playerid][bExtID] = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, Player[playerid][sOrderX], Player[playerid][sOrderY], Player[playerid][sOrderZ]);
- Subway[StoreID][sStoreOrderPointID] = CreateDynamicPickup(1318, 1, Player[playerid][sOrderX], Player[playerid][sOrderY], Player[playerid][sOrderZ], 0, -1, -1, 150.0);
- Subway[StoreID][sOrderPointX] = Player[playerid][sOrderX];
- Subway[StoreID][sOrderPointY] = Player[playerid][sOrderY];
- Subway[StoreID][sOrderPointZ] = Player[playerid][sOrderZ];
- SendClientMessage(playerid, WHITE, "You have set the order point!");
- FirstOrderPointSet = 1;
- Subway[StoreID][OrderMenu] ++;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You're either too close or too far away!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "This order point has already been set!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Store ID 1 hasn't been created yet!");
- }
- }
- else if(id == 2)
- {
- if(StoreID >= 2)
- // you know dat one ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement