Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***************************************************************
- * *
- * Movie Making Gamemode v2.0 *
- * (c) 2013. B-Matt *
- * *
- ****************************************************************/
- //Includes
- #include <a_samp>
- #include <ZCMD>
- #include <sscanf2>
- //Colors
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_RED 0xFF0000CC
- #define COLOR_LIGHTBLUE 0x0096FFCC
- #define COLOR_YELLOW 0xFFD100FF
- //Dialogs
- #define DIALOG_PORT 1
- //Variables
- new Name[MAX_PLAYERS]; //var for /name CMD
- new Godmode[2]; //godmode var
- new CountDown = 0; //Countdown variable
- new CountT; //Count timer variables
- new Count; //security check for count
- new control[MAX_PLAYERS]; //var for freeze
- new DelObject; //var for deleting object
- new TArmed[MAX_PLAYERS];
- new BombO; //bomb object
- //Forwards
- forward OnCountdown(playerid);
- main()
- {
- print("\n ===========================");
- print(" Movie Making Gamemode");
- print(" (c) B-Matt, 2013.");
- print(" ===========================\n");
- }
- //SA-MP callbacks
- public OnGameModeInit()
- {
- SetGameModeText("Movie Making v2");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Name[playerid] = 1;
- control[playerid] = 1;
- return 1;
- }
- public OnVehicleDamageStatusUpdate(vehicleid, playerid)
- {
- #pragma unused playerid
- if(Godmode[0] == 1) {
- new panels, doors, lights, tires;
- GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
- tires = encode_tires(0, 0, 0, 0);
- panels = encode_panels(0, 0, 0, 0, 0, 0, 0);
- doors = encode_doors(0, 0, 0, 0, 0, 0);
- lights = encode_lights(0, 0, 0, 0);
- UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires); }
- return 1;
- }
- encode_tires(tire1, tire2, tire3, tire4) return tire1 | (tire2 << 1) | (tire3 << 2) | (tire4 << 3);
- encode_panels(flp, frp, rlp, rrp, windshield, front_bumper, rear_bumper)
- {
- return flp | (frp << 4) | (rlp << 8) | (rrp << 12) | (windshield << 16) | (front_bumper << 20) | (rear_bumper << 24);
- }
- encode_doors(bonnet, boot, driver_door, passenger_door, behind_driver_door, behind_passenger_door)
- {
- #pragma unused behind_driver_door
- #pragma unused behind_passenger_door
- return bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24);
- }
- encode_lights(light1, light2, light3, light4)
- {
- return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (newkeys & KEY_FIRE) //Triger Bomb
- {
- if(TArmed[playerid] == 1)
- {
- new Float:X, Float:Y, Float:Z;
- GetObjectPos(BombO, X, Y, Z);
- CreateExplosion(X, Y, Z, 2, 100.0);
- CreateExplosion(X, Y, Z, 12, 25.0);
- CreateExplosion(X, Y, Z, 10, 30.0);
- DestroyObject(BombO);
- TArmed[playerid] = 0;
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_PORT)
- {
- switch(listitem)
- {
- case 0: //LS
- {
- if (GetPlayerState(playerid) == 2) {
- new tmpcar = GetPlayerVehicleID(playerid);
- SetVehiclePos(tmpcar, 1529.6,-1691.2,13.3); }
- else {
- SetPlayerPos(playerid, 1529.6,-1691.2,13.3);
- SendClientMessage(playerid, COLOR_WHITE, "You are teleported in front of police station!");
- SetPlayerInterior(playerid,0); }
- }
- case 1: //Bay Side
- {
- if (GetPlayerState(playerid) == 2) {
- new tmpcar = GetPlayerVehicleID(playerid);
- SetVehiclePos(tmpcar, -2404.67, 2217.72, 4.98); }
- else {
- SetPlayerPos(playerid, -2404.67, 2217.72, 4.98);
- SendClientMessage(playerid, COLOR_WHITE, "You are teleported at Bay Side !");
- SetPlayerInterior(playerid,0); }
- }
- case 2: //burg
- {
- new tmpcar = GetPlayerVehicleID(playerid);
- if (GetPlayerState(playerid) == 2) {
- SetVehiclePos(tmpcar, 1194.6770,-923.1213,43.0762); }
- else {
- SetPlayerPos(playerid, 1194.6770,-923.1213,43.0762);
- SendClientMessage(playerid, COLOR_WHITE, "You are teleported in front of North Burg!");
- SetPlayerInterior(playerid,0); }
- }
- case 3: //banka
- {
- new tmpcar = GetPlayerVehicleID(playerid);
- if (GetPlayerState(playerid) == 2) {
- SetVehiclePos(tmpcar, 1459.9022,-1024.1600,23.8281); }
- else {
- SetPlayerPos(playerid, 1459.9022,-1024.1600,23.8281);
- SendClientMessage(playerid, COLOR_WHITE, "You are teleported in front of Bank!");
- SetPlayerInterior(playerid,0); }
- }
- case 4: //aero
- {
- new tmpcar = GetPlayerVehicleID(playerid);
- if (GetPlayerState(playerid) == 2) {
- SetVehiclePos(tmpcar, 1963.0913,-2199.6104,13.5469); }
- else {
- SetPlayerPos(playerid, 1963.0913,-2199.6104,13.5469);
- SendClientMessage(playerid, COLOR_WHITE, "You are teleported at Aero!");
- SetPlayerInterior(playerid,0); }
- }
- case 5: //aera
- {
- new tmpcar = GetPlayerVehicleID(playerid);
- if (GetPlayerState(playerid) == 2) {
- SetVehiclePos(tmpcar, 110.8750,1921.0206,18.6678); }
- else {
- SetPlayerPos(playerid, 110.8750,1921.0206,18.6678);
- SendClientMessage(playerid, COLOR_WHITE, "You are teleported in Area 51!");
- SetPlayerInterior(playerid,0); }
- }
- case 6: //LV
- {
- new tmpcar = GetPlayerVehicleID(playerid);
- if (GetPlayerState(playerid) == 2) {
- SetVehiclePos(tmpcar, 1699.2, 1435.1, 10.7); }
- else {
- SetPlayerPos(playerid, 1699.2,1435.1, 10.7);
- SendClientMessage(playerid, COLOR_WHITE, "You are teleported at Aero LV!");
- SetPlayerInterior(playerid,0); }
- }
- case 7: //desert
- {
- new tmpcar = GetPlayerVehicleID(playerid);
- if (GetPlayerState(playerid) == 2) {
- SetVehiclePos(tmpcar, 400.9437,2522.5730,16.4844); }
- else {
- SetPlayerPos(playerid, 400.9437,2522.5730,16.4844);
- SendClientMessage(playerid, COLOR_WHITE, "You are teleported in front of Aero in desert!");
- SetPlayerInterior(playerid,0); }
- }
- case 8: //SF
- {
- new tmpcar = GetPlayerVehicleID(playerid);
- if (GetPlayerState(playerid) == 2) {
- SetVehiclePos(tmpcar, -1417.0,-295.8,14.1); }
- else {
- SetPlayerPos(playerid, -1417.0,-295.8,14.1);
- SendClientMessage(playerid, COLOR_WHITE, "You are teleported in front of Aero SF!");
- SetPlayerInterior(playerid,0); }
- }
- case 9: //pizza
- {
- new tmpcar = GetPlayerVehicleID(playerid);
- if (GetPlayerState(playerid) == 2) {
- SetVehiclePos(tmpcar, 2112,-1784.1558,12.9844); }
- else {
- SetPlayerPos(playerid, 2112,-1784.1558,12.9844);
- SendClientMessage(playerid, COLOR_WHITE, "You are teleported in front of Pizza Stack!");
- SetPlayerInterior(playerid,0); }
- }
- case 10: //grotti
- {
- if (GetPlayerState(playerid) == 2) {
- new tmpcar = GetPlayerVehicleID(playerid);
- SetVehiclePos(tmpcar, 549.2282,-1280.4635,17.3313);
- }
- else {
- SetPlayerPos(playerid, 549.2282,-1280.4635,17.3313);
- SendClientMessage(playerid, COLOR_WHITE, "You are teleported in front of Grotti!");
- SetPlayerInterior(playerid,0); }
- }
- }
- }
- return 1;
- }
- public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
- {
- new Float:oldX, Float:oldY, Float:oldZ,
- Float:oldRotX, Float:oldRotY, Float:oldRotZ,
- Float:newX, Float:newY, Float:newZ,
- Float:newRotX, Float:newRotY, Float:newRotZ;
- GetObjectPos(objectid, oldX, oldY, oldZ);
- GetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
- if(!playerobject)
- {
- if(!IsValidObject(objectid)) return;
- MoveObject(objectid, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
- }
- if(response == EDIT_RESPONSE_FINAL)
- {
- SetObjectRot(objectid, newX, newY, newZ);
- SetObjectPos(objectid, newRotX, newRotY, newRotZ);
- CancelEdit(playerid);
- }
- if(response == EDIT_RESPONSE_CANCEL)
- {
- if(!playerobject)
- {
- SetObjectPos(objectid, oldX, oldY, oldZ);
- SetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
- CancelEdit(playerid);
- }
- }
- }
- public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
- {
- if(type == SELECT_OBJECT_GLOBAL_OBJECT)
- {
- if(DelObject == 1)
- {
- DestroyObject(objectid);
- CancelEdit(playerid);
- SendClientMessage(playerid, COLOR_YELLOW, " You deleted that object!");
- }
- else
- {
- EditObject(playerid, objectid);
- SendClientMessage(playerid, 0xFFFFFFFF, " You are now editing your object!");
- }
- }
- return 1;
- }
- //Custom callbacks
- public OnCountdown(playerid)
- {
- CountDown--;
- new string[16];
- if(CountDown == 0)
- {
- format(string, sizeof(string), "~r~ Start!");
- GameTextForAll(string, 1000, 6);
- KillTimer(CountT);
- CountDown = 0;
- Count = 0;
- }
- else
- {
- format(string, sizeof(string), "%i", CountDown);
- GameTextForAll(string, 1000, 6);
- }
- return 1;
- }
- //CMDs
- CMD:help(playerid, params[])
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________* {FFFFFF}HELP{0096FF} *_____________________________");
- SendClientMessage(playerid, -1, " /veh - /deleteveh - /gethere - /port - /cargod - /god - /name - /cchat - /disarm");
- SendClientMessage(playerid, -1, " /object - /mod - /gun - /goto - /set - /count - /anims - /fix - /plant - /time");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "________________________________________________________________");
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- new pID, pName[MAX_PLAYER_NAME], reason[32], string[128];
- if(IsPlayerAdmin(playerid)) {
- if(sscanf(params, "us[32]", pID, reason)) return SendClientMessage(playerid, -1, "USAGE: /kick [ID/Name]");
- GetPlayerName(pID, pName, sizeof(pName));
- format(string, sizeof(string), "%s has been kicked by Admin, reason: %s", pName, reason);
- SendClientMessageToAll(COLOR_YELLOW, string);
- Kick(pID); }
- return 1;
- }
- CMD:veh(playerid, params[])
- {
- new Float:Pos[4], vehicleid, color1, color2;
- if(sscanf(params, "iii", vehicleid, color1, color2)) return SendClientMessage(playerid, -1, "USAGE: /veh [VehicleID][Color1][Color2]");
- if(vehicleid < 400 || vehicleid > 611) return SendClientMessage(playerid, COLOR_RED, "Wrong vehicle ID input! (400-611)");
- if(color1 > 255 || color1 < 0) return SendClientMessage(playerid, COLOR_RED, "Wrong color input! (0-255)");
- if(color2 < 0 || color2 > 255) return SendClientMessage(playerid, COLOR_RED, "Wrong color input! (0-255)");
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(playerid, Pos[3]);
- vehicleid = CreateVehicle(vehicleid, Pos[0], Pos[1], Pos[2], Pos[3], color1, color2, 60);
- PutPlayerInVehicle(playerid, vehicleid, 0);
- return 1;
- }
- CMD:deleteveh(playerid, params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(IsPlayerInVehicle(playerid, vehicleid)) {
- DestroyVehicle(vehicleid); }
- return 1;
- }
- CMD:gethere(playerid, params[])
- {
- new Float:Pos[3], pID;
- if(sscanf(params, "u", pID)) return SendClientMessage(playerid, -1, "USAGE: /gethere [ID/Name]");
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(pID, Pos[0]+2, Pos[1]+2, Pos[2]);
- return 1;
- }
- CMD:goto(playerid,params[])
- {
- new Float:Pos[3], pID;
- if(sscanf(params, "u", pID)) return SendClientMessage(playerid, -1, "USAGE: /goto [ID/Name]");
- GetPlayerPos(pID, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(playerid, Pos[0]+2, Pos[1]+2, Pos[2]);
- return 1;
- }
- CMD:port(playerid, params[])
- {
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Port", "Los Santos\nBay Side\nBurg\nBanka\nAerodrom\nArea 51\nLas Venturas\nDesert\nSan Fiero\nPizza Stacked\nGrotti\n", "Select", "Quit");
- return 1;
- }
- CMD:cargod(playerid, params[])
- {
- if(Godmode[0] == 0) {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, " You activate God Mode on your vehicle!");
- Godmode[0] = 1; }
- else {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, " You deactivate God Mode on your vehicle!");
- Godmode[0] = 0; }
- return 1;
- }
- CMD:god(playerid, params[])
- {
- if(Godmode[1] == 0) {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, " You activate God Mode!");
- Godmode[1] = 1;
- SetPlayerArmour(playerid, 300.0);
- SetPlayerHealth(playerid, 300.0); }
- else {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, " You deactivate God Mode!");
- Godmode[1] = 0; }
- return 1;
- }
- CMD:name(playerid, params[])
- {
- if(Name[playerid] == 1) {
- for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, false);
- GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 6);
- Name[playerid] = 0;}
- else {
- for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, true);
- GameTextForPlayer(playerid, "~W~Nametags ~R~On", 5000, 6);
- Name[playerid] = 1;}
- return 1;
- }
- CMD:gun(playerid, params[])
- {
- new gun, ammo;
- if(sscanf(params, "ii", gun, ammo)) return SendClientMessage(playerid, -1, "USAGE:/gun [WeaponID (1-46)][Ammo]");
- if(gun > 46 || gun < 0) return SendClientMessage(playerid, COLOR_RED, "Wrong WeaponID input (1-46)!");
- GivePlayerWeapon(playerid, gun, ammo);
- return 1;
- }
- CMD:object(playerid, params[])
- {
- new item[32], Float:Pos[4], objectid;
- if (sscanf(params, "s[32] ", item)) {
- SendClientMessage(playerid, -1, "USAGE: /object [option]");
- SendClientMessage(playerid, -1, "Options: create, edit, delete");
- return 1; }
- if(strcmp(item,"create",true) == 0) {
- if(sscanf(params, "s[32]i", item, objectid)) return SendClientMessage(playerid, COLOR_WHITE, "KORISTENJE: /object create [ObjectID]");
- if(objectid < 761 || objectid > 3399) return SendClientMessage(playerid, COLOR_RED, "Wrong ObjectID input (761-3399)!");
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(playerid, Pos[3]);
- CreateObject(objectid, Pos[0]+2, Pos[1]+2, Pos[2], 0, 0, Pos[3], 100);
- }
- else if(strcmp(item,"edit",true) == 0)
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, " Please select object for editing.");
- SelectObject(playerid);
- }
- else if(strcmp(item,"delete",true) == 0)
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, " Please select object for deleting.");
- SelectObject(playerid);
- DelObject = 1;
- }
- return 1;
- }
- CMD:mod(playerid, params[])
- {
- new NOS, vehicleid = GetPlayerVehicleID(playerid);
- if(GetPlayerState(playerid) == 2) {
- if(NOS == 0) {
- AddVehicleComponent(vehicleid, 1010);
- SendClientMessage(playerid, COLOR_YELLOW, " You add nitro to your vehicle!");
- NOS = 1; }
- else {
- RemoveVehicleComponent(1,1010);
- SendClientMessage(playerid, COLOR_YELLOW, " You remove nitro from your vehicle!");
- NOS = 0; }
- }
- return 1;
- }
- CMD:set(playerid, params[])
- {
- new item[32], pID,
- Float:armour, Float:health;
- if(sscanf(params, "s[32] ", item))
- {
- SendClientMessage(playerid, -1, "USAGE: /set [Option]");
- SendClientMessage(playerid, -1, "Options: armour, health, skin, control (freezes the player)");
- return 1;
- }
- else if(strcmp(item, "armour", true) == 0)
- {
- if(sscanf(params, "s[32]f", item, armour)) return SendClientMessage(playerid, -1, "USAGE: /set armour [Armour]");
- SetPlayerArmour(playerid, armour);
- }
- else if(strcmp(item, "health", true) == 0)
- {
- if(sscanf(params, "s[32]f", item, health)) return SendClientMessage(playerid, -1, "USAGE: /set health [ID/Name][Health]");
- SetPlayerHealth(playerid, health);
- }
- else if(strcmp(item, "skin", true) == 0)
- {
- new skin;
- if(sscanf(params, "s[32]ui", item, pID, skin)) return SendClientMessage(playerid, -1, "USAGE: /set skin [ID/Name][SkinID]");
- if(skin < 0 || skin > 299) return SendClientMessage(playerid, COLOR_RED, "Wrong SkinID input (0-299)!");
- SetPlayerSkin(pID, skin);
- }
- else if(strcmp(item, "control", true) == 0)
- {
- if(sscanf(params, "s[32]u", item, pID)) return SendClientMessage(playerid, -1, "USAGE: /set control [ID/Name]");
- if(control[pID] == 0) {
- TogglePlayerControllable(pID,1);
- control[pID] = 1; }
- else {
- TogglePlayerControllable(pID,0);
- control[pID] = 0; }
- }
- return 1;
- }
- CMD:fix(playerid, params[])
- {
- new tires, panels, doors, lights,
- vehicleid = GetPlayerVehicleID(playerid);
- SetVehicleHealth(vehicleid, 1000.0);
- tires = encode_tires(0, 0, 0, 0);
- panels = encode_panels(0, 0, 0, 0, 0, 0, 0);
- doors = encode_doors(0, 0, 0, 0, 0, 0);
- lights = encode_lights(0, 0, 0, 0);
- UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
- return 1;
- }
- CMD:count(playerid, params[])
- {
- if(Count == 0)
- {
- if(sscanf(params, "i", CountDown)) return SendClientMessage(playerid, -1, "USAGE: /count [Time]");
- CountT = SetTimer("OnCountdown", 1000, true);
- }
- else return SendClientMessage(playerid, COLOR_RED, "You already started countdown!");
- return 1;
- }
- CMD:cchat(playerid, params[])
- {
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- return 1;
- }
- CMD:plant(playerid, params[])
- {
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 0, 0, 0, 0, 1000, 1);
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- BombO = CreateObject(1252, X, Y, Z, 0.0, 0.0, 96.0);
- TArmed[playerid] = 1;
- GivePlayerWeapon(playerid, 40, 2);
- return 1;
- }
- CMD:disarm(playerid, params[])
- {
- new pID;
- if(sscanf(params, "u", pID)) return SendClientMessage(playerid, -1, "USAGE: /disarm [ID/Name]");
- ResetPlayerWeapons(pID);
- SendClientMessage(playerid, COLOR_YELLOW, " You disarm that player!");
- return 1;
- }
- CMD:time(playerid, params[])
- {
- new time;
- if(sscanf(params, "i", time)) return SendClientMessage(playerid, -1, "USAGE: /time [Hours]");
- SetWorldTime(time);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement