Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- //Defines
- #define GREEN 0x21DD00FF
- #define RED 0xE60000FF
- #define CO_RED 0xFF0000FF
- //news
- new God[MAX_PLAYERS];
- new Text:godon;
- new Text:godoff;
- new Text3D:godtext[MAX_PLAYERS];
- stock Godon(playerid)
- {
- TextDrawShowForPlayer(playerid, godon);
- TextDrawHideForPlayer(playerid, godoff);
- }
- stock Godoff(playerid)
- {
- TextDrawShowForPlayer(playerid, godoff);
- TextDrawHideForPlayer(playerid, godon);
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" God Textdraw Samp by commander_Limo ");
- print("--------------------------------------\n");
- godon = TextDrawCreate(503, 123, "GodMode: ON");
- TextDrawBackgroundColor(godon, -1);
- TextDrawFont(godon, 3);
- TextDrawLetterSize(godon, 0.5, 3.5);
- TextDrawColor(godon, 0xFF2429FF);
- TextDrawSetOutline(godon, 1);
- TextDrawSetProportional(godon, 1);
- TextDrawSetSelectable(godon, 0);
- godoff = TextDrawCreate(503, 123, "GodMode: OFF");
- TextDrawBackgroundColor(godoff, -1);
- TextDrawFont(godoff, 3);
- TextDrawLetterSize(godoff, 0.5, 3.5);
- TextDrawColor(godoff, 0xFF2429FF);
- TextDrawSetOutline(godoff, 1);
- TextDrawSetProportional(godoff, 1);
- TextDrawSetSelectable(godoff, 0);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- CMD:god(playerid, params[])
- {
- if(God[playerid] == 0)
- {
- new string[128];
- SetPlayerHealth(playerid, 99999999999.0);
- SetPlayerArmour(playerid, 99999999999.0);
- SendClientMessage(playerid, GREEN, "GodMode On You Will never Die!");
- God[playerid] = 1;
- Godon(playerid);
- format(string,sizeof(string)," %s : Enabled GodMode!",GetPlayerNameEx(playerid)); //Format string to send to players
- SendClientMessageToAll(RED,string); //send players string
- GameTextForPlayer(playerid,"~r~]GOD MODE ~g~ACTIVATED",4100,3);
- godtext[playerid] = Create3DTextLabel("GODMODE ENABLED",CO_RED,30.0,40.0,50.0,40.0,0);
- Attach3DTextLabelToPlayer(godtext[playerid], playerid, 0.0, 0.0, 0.7);
- }
- else if(God[playerid] == 1)
- {
- new string[128];
- SetPlayerHealth(playerid, 100.0); // set player health to infinite
- SetPlayerArmour(playerid, 0.0); // set player armour to infinite
- SendClientMessage(playerid, RED, "GodMode Off Health Restore :@!");
- Godoff(playerid);
- God[playerid] = 0;
- format(string,sizeof(string)," %s : Disabled GodMode!",GetPlayerNameEx(playerid)); //Format string to send to players
- SendClientMessageToAll(RED,string); //send players string
- GameTextForPlayer(playerid,"~r~]GOD MODE ~g~DEACTIVATED",4100,3);
- Delete3DTextLabel(Text3D:godtext[playerid]);
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- God[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- God[playerid] = 0;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- God[playerid] = 0;
- return 1;
- }
- stock GetPlayerNameEx(playerid) //This is stock i made to make Getting players name easier
- {
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
- return Name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement