Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- #include <sscanf2>
- #include <zcmd>
- new File[40];
- public OnPlayerConnect(playerid) {
- format(File, sizeof(File), "god/%s.ini", pName(playerid));
- if(dini_Exists(File)) {
- SetPVarInt(playerid, "God", dini_Int(File, "god"));
- }else{
- SetPVarInt(playerid, "God", 0);
- dini_Create(File);
- dini_IntSet(File, "god", 0);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason) {
- format(File, sizeof(File), "god/%s.ini", pName(playerid));
- dini_IntSet(File, "god", GetPVarInt(playerid, "God"));
- return 1;
- }
- public OnPlayerSpawn(playerid) {
- if(GetPVarInt(playerid, "God")) {
- SetPlayerHealth(playerid, 99999);
- SendClientMessage(playerid, -1, "Mivel aktiválva van neked a God mód, ezért minden spawnoláskor megkapod automatikusan!");
- }
- return 1;
- }
- CMD:god(playerid,params[]) {
- if(GetPVarInt(playerid, "God")) SetPlayerHealth(playerid, 99999);
- else return SendClientMessage(playerid, -1, "Itt nincs engedélyezve jelengleg a god");
- return 1;
- }
- CMD:setgod(playerid, params[]) {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nem vagy rcon admin");
- new giveplayerid, bool:value;
- if(sscanf(params, "ub", giveplayerid, value)) return SendClientMessage(playerid, 0xFF0000AA, "Használat: /setgod <Játékos ID/Név> <1/0>");
- if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "HIBA: Érvénytelen ID/Név.");
- SetPVarInt(giveplayerid, "God", value);
- return 1;
- }
- CMD:godoff(playerid) return SetPlayerHealth(playerid, 100);
- stock pName(playerid) {
- static getName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, getName, MAX_PLAYER_NAME);
- return getName;
- }
Advertisement
Add Comment
Please, Sign In to add comment