Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////////////////////////////////////////////////////////////
- // //
- // trablon's RolePlay tazer system for cops //
- // Coder: trablon(Onur AKAN) //
- // Tester: Woods //
- // //
- // //
- // //
- // //
- /////////////////////////////////////////////////////////////////////////////////////////
- // DIPNOT: System haven't tested YET..
- // =========== [ include ] ============== //
- #include <a_samp>
- // =========== [ define ] ============== //
- #define FILTERSCRIPT
- // =========== [ pragma ] ============== //
- // =========== [ enum ] ============== //
- // =========== [ new ] ============== //
- new tazerout[MAX_PLAYERS];
- new tazerin[MAX_PLAYERS];
- // ============================================================= //
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" ...trablon tazer system loaded...");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" ...trablon tazer system unloaded...");
- print("--------------------------------------\n");
- return 1;
- }
- #else
- #endif
- public OnPlayerConnect(playerid)
- {
- tazerout[playerid] = 0; tazerin[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- tazerout[playerid] = 0; tazerin[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- if(strcmp(cmd, "/tazer", true) == 0)
- {
- // if(DIPNOT: If player is police condition here) != 1) return SendClientMessage(playerid,-1,"Only police-men can type this command.");
- if(tazerout[playerid] == 0)
- {
- GivePlayerWeapon(playerid, 23, 99999);
- SendClientMessage(playerid,-1,"You have successfuly take off your tazer weapon from your equipment belt.");
- tazerout[playerid] = 1;
- return 1;
- }
- if(tazerin[playerid] == 1)
- {
- GivePlayerWeapon(playerid, 22, 150);
- SendClientMessage(playerid,-1,"You have successfuly take on your tazer weapon from your equipment belt.");
- tazerin[playerid] = 0;
- return 1;
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
- {
- if(issuerid != INVALID_PLAYER_ID)
- {
- new Float:armour, Float:health; GetPlayerArmour(playerid, armour); GetPlayerHealth(playerid, health);
- if(weaponid == 23)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- return 1;
- }
- if(0 != 0 && 1 == GetPlayerSkin(issuerid))
- {
- new string[66];
- format(string, sizeof(string), "* You have been shocked by %s, you have %i time to gain power !",GameTextForPlayer(issuerid, string, 2500, 3),10);
- SendClientMessage(playerid,-1,string);
- format(string, sizeof(string), "* You have been shocked by %s, you have %i time to gain power !", GameTextForPlayer(playerid,string, 2500, 3),10);
- SendClientMessage(issuerid,-1,string);
- format(string, sizeof(string), "~r~%s", "BEEN SHOCKED"); GameTextForPlayer(playerid, string, 2500, 3); TogglePlayerControllable(playerid, 0);
- ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
- SetTimerEx("uf",10*1000, false, "i", playerid);
- return 1;
- }
- else
- {
- new string[66];
- format(string, sizeof(string), "* You have been shocked by %s, you have %i time to gain power !", GetPlayerNameEx(issuerid),10); SendClientMessage(playerid,-1,string);
- format(string, sizeof(string), "* You have been shocked by %s, you have %i time to gain power !", GetPlayerNameEx(playerid),10); SendClientMessage(issuerid,-1,string);
- format(string, sizeof(string), "~r~%s", "BEENSHOCKED"); GameTextForPlayer(playerid, string, 2500, 3); TogglePlayerControllable(playerid, 0);
- ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); SetTimerEx("uf",10*1000, false, "i", playerid);
- return 1;
- }
- }
- }
- return 1;
- }
- //==================== [ stock ] =========================//
- stock GetPlayerNameEx(playerid)
- {
- new string[24];
- GetPlayerName(playerid,string,24);
- new str[24];
- strmid(str,string,0,strlen(string),24);
- for(new i = 0; i < MAX_PLAYER_NAME; i++)
- {
- if (str[i] == '_') str[i] = ' ';
- }
- return str;
- }
- // =========== [ forward ] ============== //
- // =========== [ END ] ============== //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement