30.10.2015, 15:18
Код:
new string[128], Float:heal, price; if(sscanf(params, "sfi", string, heal, price)) { SendClientMessage(playerid, COLOR_RED, "? /createsprunk [vendingmachine] [heal bonus] [price]"); return SendClientMessage(playerid, COLOR_RED, " Type /vendingmachines"); } for(new int = 0; int < sizeof(VendingMachines); int++) { if(strcmp(string, VendingMachines[int][vmName], true)) for(new i = 0; i < MAX_VENDING_MACHINES; i++) { GetPlayerPos(playerid, SprunkMachines[i][SprunkObjectX1], SprunkMachines[i][SprunkObjectY1], SprunkMachines[i][SprunkObjectZ]); GetPlayerFacingAngle(playerid, SprunkMachines[i][SprunkObjectA]); SprunkMachines[i][SprunkHeal] = heal; SprunkMachines[i][SprunkPrice] = price; SprunkMachines[i][SprunkModelID] = VendingMachines[int][vmModel]; SprunkMachines[i][SprunkCreated] = true; new Float:X, Float:Y; SprunkMachines[i][SprunkObjectID] = CreateDynamicObject(SprunkMachines[i][SprunkModelID], SprunkMachines[i][SprunkObjectX1], SprunkMachines[i][SprunkObjectY1], SprunkMachines[i][SprunkObjectZ], 0.0, 0.0, SprunkMachines[i][SprunkObjectA]-180); X = SprunkMachines[i][SprunkObjectX1], Y = SprunkMachines[i][SprunkObjectY1]; GetXYInFrontOfSprunk(X, Y, SprunkMachines[i][SprunkObjectA]); SprunkMachines[i][SprunkPickupID] = CreateDynamicPickup(1274, 23, X, Y, SprunkMachines[i][SprunkObjectZ]); SprunkMachines[i][SprunkObjectX2] = X, SprunkMachines[i][SprunkObjectY2] = Y; SprunkMachines[i][SprunkCreated] = true;