Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- // Advanced God-mode by Evan Abagail!
- // Version 4
- #include <zcmd>
- #include sscanf
- new IsInGod[MAX_PLAYERS];
- new IsInCarGod[MAX_PLAYERS];
- CMD:god(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- if(IsInGod[playerid] == 0)
- {
- IsInGod[playerid] = 1;
- SetPlayerHealth(playerid, 99999);
- SendClientMessage(playerid, 0xFFFFFFFF, "Godmode activated.");
- }
- else if(IsInGod[playerid] == 1)
- {
- IsInGod[playerid] = 0;
- SetPlayerHealth(playerid, 100);
- SendClientMessage(playerid, 0xFFFFFFFF, "Godmode de-activated.");
- }
- }
- else SendClientMessage(playerid, 0xFFFFFFFF, "You are not authorized to use this command.");
- return 1;
- }
- CMD:givegod(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new string[128], giveplayerid, statcode, amount;
- if(sscanf(params, "u", giveplayerid))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "You must enter a PLAYERID!");
- return 1;
- }
- if(IsPlayerConnected(giveplayerid))
- {
- if(IsInGod[playerid] == 0)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "You have given the indicated player god-mode!");
- SendClientMessage(giveplayerid, 0xFFFFFFFF, "An Administrator has given you god-mode!");
- IsInGod[playerid] = 1;
- SetPlayerHealth(giveplayerid, 100000);
- SetPlayerArmour(giveplayerid, 100000);
- new string[128];
- }
- else if(IsInGod[playerid] == 1)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "You have turned off the indicated players god-mode.");
- SendClientMessage(giveplayerid, 0xFFFFFFFF, "An Administrator has removed your god-mode!");
- IsInGod[playerid] = 0;
- SetPlayerHealth(giveplayerid, 100);
- SetPlayerArmour(giveplayerid, 100);
- }
- }
- }
- return 1;
- }
- CMD:cargod(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- if(IsInCarGod[playerid] == 0)
- {
- IsInCarGod[playerid] = 1;
- new vehicle;
- vehicle = GetPlayerVehicleID(playerid);
- {
- SetVehicleHealth(vehicle, 99999999);
- }
- SendClientMessage(playerid, 0xFFFFFFFF, "Car Godmode activated.");
- }
- else if(IsInCarGod[playerid] == 1)
- {
- IsInCarGod[playerid] = 0;
- SetPlayerHealth(playerid, 100);
- SendClientMessage(playerid, 0xFFFFFFFF, "Car Godmode de-activated.");
- }
- }
- else SendClientMessage(playerid, 0xFFFFFFFF, "You are not authorized to use this command.");
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(IsInGod[playerid] == 1) SetPlayerHealth(playerid, 99999);
- else if(IsInCarGod[playerid] == 1) CarGod(playerid);
- return 1;
- }
- public CarGod(playerid)
- {
- IsInCarGod[playerid] = 1;
- new vehicle;
- vehicle = GetPlayerVehicleID(playerid);
- {
- SetVehicleHealth(vehicle, 99999999);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement