04.10.2014, 20:56
everytime i do createpump it crashes my game with op codes.
Код:
CMD:createpump(playerid, params[]) { static id, bizid = -1; if (PlayerData[playerid][pAdmin] < 5) return SendErrorMessage(playerid, "You don't have permission to use this command."); if (sscanf(params, "d", bizid)) return SendSyntaxMessage(playerid, "/createpump [business id]"); if ((bizid < 0 || bizid >= MAX_BUSINESSES) || !BusinessData[bizid][bizExists]) return SendErrorMessage(playerid, "You have specified an invalid business ID."); if (BusinessData[bizid][bizType] != 6) return SendErrorMessage(playerid, "This business is not a gas station!"); if (GetPlayerInterior(playerid) > 0 || GetPlayerVirtualWorld(playerid) > 0) return SendErrorMessage(playerid, "You can only create gas pumps outside interiors."); id = Pump_Create(playerid, bizid); if (id == -1) return SendErrorMessage(playerid, "The business has reached the limit for gas pumps."); SendServerMessage(playerid, "You have successfully created gas pump ID: %d.", id); EditDynamicObject(playerid, PumpData[id][pumpObject]); PlayerData[playerid][pEditPump] = id; return 1; }