21.10.2016, 12:17
Код:
new Text3DTimer; new Text3DTimer2; new getcar = GetPlayerVehicleID(MAX_PLAYERS); new Text3D:vehicle3Dtext[MAX_VEHICLES]; ------------------------------------------------------------- if(strcmp(cmd, "/emergency", true) == 0) { if(!IsACop(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "You are not a cop"); if(!(IsPlayerInAnyVehicle(playerid))) return SendClientMessage(playerid, COLOR_BLUE, "You must be in vehicle"); vehicle3Dtext[getcar] = Create3DTextLabel("Police Emergency", -1, 0.0, 0.0, 0.0, 50.0, 0, 1); Attach3DTextLabelToVehicle(vehicle3Dtext[getcar], getcar, -0.8, -2.8, -0.3); SendClientMessage(playerid, COLOR_BLUE, "USAGE: /stopemergency- when done."); Text3DTimer = SetTimer("UpdateText3D", 4000, true); return 1; } if(strcmp(cmd, "/stopemergency", true) == 0) { if(!IsACop(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "You are not a cop"); if(!(IsPlayerInAnyVehicle(playerid))) return SendClientMessage(playerid, COLOR_BLUE, "You must be in vehicle"); Delete3DTextLabel(vehicle3Dtext[getcar]); KillTimer(Text3DTimer); KillTimer(Text3DTimer2); return 1; } ------------------------------------------------------------- forward UpdateText3D(); public UpdateText3D() { Update3DTextLabelText(vehicle3DText[getcar], 0xFFFFF, "Keep Back"); Text3DTimer2 = SetTimer("UpdateText3D2", 4000, true); KillTimer(Text3DTimer); return 1; } forward UpdateText3D2(); public UpdateText3D2() { Update3DTextLabelText(vehicle3DText[getcar], 0xFFFFF, "Police Emergency"); Text3DTimer2 = SetTimer("UpdateText3D", 4000, true); KillTimer(Text3DTimer2); return 1; }