Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- DM Event by ZukerCup And Specail Thanks to ZCMD & Sscanf
- Hope u enjoy it , contact me at http://forum.sa-mp.com/member.php?u=289876
- if u found any bug in the script
- */
- ////////////////////////////////////////////////
- #include <a_samp>
- #include <ZCMD>
- #include <sscanf2>
- #define COLOR_RED 0xFF0000FF
- #define COLOR_Grey 0xAFAFAFAA
- #define COLOR_Green 0x33AA33AA
- #define COLOR_Gold 0xB8860BAA
- enum info
- {
- dmwep
- }
- new ServerData[info];
- ////////////////////////////////////////////////////
- new IsInDm[MAX_PLAYERS], IsDmStarted = 0, IsADm = 0;
- public OnFilterScriptInit()
- {
- print("\n*****************************************");
- print("DM-Event By ZukerCup Loaded...");
- print("*****************************************\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(IsInDm[playerid] == 1)
- {
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- ResetPlayerWeapons(playerid);
- IsInDm[playerid] = 0;
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(IsInDm[playerid] == 1)
- {
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- ResetPlayerWeapons(playerid);
- IsInDm[playerid] = 0;
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- ResetPlayerWeapons(playerid);
- IsInDm[playerid] = 0;
- return 1;
- }
- CMD:dmevent(playerid, params[])
- {
- new wepid;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]You Are Not Admin!");
- if(IsADm == 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR]There is Already a DM event OPENED");
- if(sscanf(params, "i", wepid))
- {
- SendClientMessage(playerid, COLOR_Grey, " /dmevent <weaponid>");
- }
- else
- {
- SendClientMessageToAll(COLOR_Gold, "An Administrator has Opened a DM event to join /joindm");
- SendClientMessage(playerid, COLOR_Gold, "u have Opened the Dm event to start it do /startdm and to close it /offdmevent");
- IsADm = 1;
- ServerData[dmwep] = wepid;
- }
- return 1;
- }
- CMD:offdmevent(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]You Are Not Admin!");
- if(IsADm == 0 ) return SendClientMessage(playerid, COLOR_RED, "[ERROR]There is No DM event OPENED");
- else
- {
- SendClientMessageToAll(COLOR_Gold, "An Administrator has Closed DM event");
- IsADm = 0;
- }
- return 1;
- }
- CMD:startdm(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]You Are Not Admin!");
- if(IsADm == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR]There is No DM event OPENED");
- if(IsDmStarted == 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR]The Event is already started");
- else
- {
- SendClientMessageToAll(COLOR_Gold, "An Administrator has Started The DM event (No one can join anymore)");
- IsDmStarted = 1;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsInDm[playerid] == 1)
- {
- TogglePlayerControllable(i,1);
- GameTextForPlayer(i, "EVENT STARTED!", 5000, 5);
- }
- }
- }
- return 1;
- }
- CMD:joindm(playerid, params[])
- {
- if(IsInDm[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR]You Are Already in The DM event");
- if(IsADm == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR]There is No DM event OPENED");
- if(IsDmStarted == 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR]The Event is started you cant join");
- new randSpawn = random(8);
- switch(randSpawn)
- {
- case 0:
- {
- SetPlayerPos(playerid, -1129.8909, 1057.5424, 1346.4141);
- }
- case 1:
- {
- SetPlayerPos(playerid, -974.1805, 1077.0630, 1344.9895);
- }
- case 2:
- {
- SetPlayerPos(playerid, -997.8885, 1096.0400, 1342.6517);
- }
- case 3:
- {
- SetPlayerPos(playerid, -1036.1115, 1024.3964, 1343.3551);
- }
- case 4:
- {
- SetPlayerPos(playerid, -1075.6144, 1032.7413, 1342.7317);
- }
- case 5:
- {
- SetPlayerPos(playerid, -1085.2362, 1053.7657, 1343.3536);
- }
- case 6:
- {
- SetPlayerPos(playerid, -1101.0815, 1084.6434, 1341.8438);
- }
- case 7:
- {
- SetPlayerPos(playerid, -1093.1536, 1058.8173, 1341.3516);
- }
- }
- // No team during DM
- SetPlayerTeam(playerid, NO_TEAM);
- SetPlayerInterior(playerid, 10);
- SetPlayerVirtualWorld(playerid, 520);
- IsInDm[playerid] = 1;
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, 0);
- TogglePlayerControllable(playerid, 0);
- ResetPlayerWeapons(playerid);
- GivePlayerWeapon(playerid, ServerData[dmwep], 5000);
- GameTextForPlayer(playerid, "THE EVENT WILL START SHORTLY!~n~~r~You are temporarily frozen", 10000, 5);
- return 1;
- }
- // this to give the winner money hope u enjoy it....
- CMD:givecash(playerid, params[])
- {
- new otherid, cash;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]You Are Not Admin!");
- if(sscanf(params, "uii", otherid, cash))
- {
- SendClientMessage(playerid, COLOR_Grey, " <playerid> <money>");
- }
- else
- {
- GivePlayerMoney(otherid, cash);
- new message[128], name[150];
- GetPlayerName(otherid, name, sizeof(name));
- GivePlayerMoney(otherid, cash);
- format(message, sizeof(message), "An administrator has given you money cost {FFDC2E}(%i$)", cash);
- SendClientMessage(otherid, COLOR_Green, message);
- format(message, sizeof(message), "You Have given %s money cost {FFDC2E}(%i$)", name, cash);
- SendClientMessage(otherid, COLOR_Green, message);
- }
- return 1;
- }
- /*
- THE END OF THE SCRIPT HOPE U ENJOYED IT THIS SCRIPT HAS BEEN MADE BY ZUKERCUP AND SEPCAIL Thanks To SSCANF Credits And ZCMD Credits
- AND IF YOU FOUND ANY BUG IN THE SCRIPT PLEASE TELL ME IN MY FORUM.SAMP ACCOUNT LINK http://forum.sa-mp.com/member.php?u=289876 THANKS.
- */
Advertisement
Add Comment
Please, Sign In to add comment