godmode in /whois
#1

im having problem with adding godmode in this codes. i mean like when he type /god, his account will say Godmoden (or off) i cant get it done if you dont understand what im saying i could explain some more.
here is the /god command
Код:
CMD:god(playerid, params[])
{
    new str[128];
    if(PlayerAcc[playerid][Log] == 0) return SendClientMessage(playerid, COLOR_RED, "Error: You are not logged in!");
	if(PlayerAcc[playerid][Admin] >= 3)
	{
		if(PlayerAcc[playerid][God] == 0)
		{
			SetPlayerArmour(playerid, 100.0);
			SetPlayerHealth(playerid, 5000.0);
			HealthTimer[playerid] = SetTimerEx("SetToGod", 1000, true, "d", playerid);
			format(str, sizeof(str), "Administrator %s(%d) is now on god mode!", GetName(playerid), playerid);
			SendClientMessageToAll(COLOR_LIME, str);
			GodM[playerid] = Create3DTextLabel("God Mode!", COLOR_ORANGE, 0.0, 0.0, 40.0, 20.0, 0, 1);
			Attach3DTextLabelToPlayer(GodM[playerid], playerid, 0.0, 0.0, 0.40);
			PlayerAcc[playerid][God] = 1;
		}
		else if(PlayerAcc[playerid][God] == 1)
		{
			format(str, sizeof(str), "Administrator %s(%d) is now off god mode!", GetName(playerid), playerid);
			SendClientMessageToAll(COLOR_YELLOW, str);
			Delete3DTextLabel(GodM[playerid]);
			KillTimer(HealthTimer[playerid]);
			SetPlayerHealth(playerid, 100.0);
			PlayerAcc[playerid][God] = 0;
		}
	}
	else return ErrorMessages(playerid, 7);
	return 1;
}
and the /whois command
Код:
CMD:whois(playerid, params[])
{
	new str[128], zone[MAX_ZONE_NAME], str2[128], string[128], str3[128], id;
    if(PlayerAcc[playerid][Log] == 0) return SendClientMessage(playerid, COLOR_RED, "Error: You are not logged in!");
	if(PlayerAcc[playerid][Admin] >= 1)
	{
		if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "Syntax: /whois (id)");
        if(id == INVALID_PLAYER_ID) return ErrorMessages(playerid, 2);
		new ip[16],
		    h, m, s,
			jail = PlayerAcc[id][Jail],
			mute = PlayerAcc[id][Mute],
			time = PlayerAcc[id][MuteTime],
			admin = PlayerAcc[id][Admin],
			vip = PlayerAcc[id][Vip],
			warn = PlayerAcc[id][Warn],
			skin = PlayerAcc[id][SaveSkin],
			wanted = GetPlayerWantedLevel(id),
			score = GetPlayerScore(id),
			money = GetPlayerMoney(id),
			kill = PlayerAcc[id][Kills],
			cookies = PlayerAcc[id][Cookies],
			death = PlayerAcc[id][Deaths];
		GetPlayerIp(id, ip, sizeof(ip));
		GetPlayer2DZone(id, zone, MAX_ZONE_NAME);
		TotalGameTime(id, h, m, s);
		switch(jail)
		{
			case 0: AdminRank = "No";
			case 1: AdminRank = "Yes";
		}
		switch(mute)
		{
			case 0: DutyStatus = "No";
			case 1: DutyStatus = "Yes";
		}
	    switch(admin)
	    {
   			case 0: Admin2 = "Player";
    		case 1: AdminRank = "Tester";
	    	case 2: AdminRank = "Co-Mod";
	    	case 3: AdminRank = "Mod";
	    	case 4: AdminRank = "Admin";
	    	case 5: AdminRank = "Leader";
	    	case 6: AdminRank = "Manager";
	    }
	    switch(vip)
	    {
			case 0: VIP = "Player";
		    case 1: VIP = "Bronze VIP";
		    case 2: VIP = "Silver VIP";
		    case 3: VIP = "Premium VIP";
	    }
		format(string, sizeof(string), "%s's Account Statistics:", GetName(id));
		SendClientMessage(playerid, COLOR_BLUE, str);
		format(str, sizeof(str), "Jail: [%s] | Mute: [%s] | Time: [%i] | Admin: [%i - %s] | Vip: [%i - %s] | Cookies: [%i]", AdminRank, DutyStatus, time, admin, Admin2, vip, VIP, cookies);
		format(str2, sizeof(str2), "Warning: [%i/%i] | WantedLvl: [%i] | Score: [%i] Money: [$%i] | Kills: [%d] | Deaths: [%d]", warn, MAX_WARNINGS, wanted, score, money, kill, death);
		format(str3, sizeof(str3), "SaveSkin: [%i] | Ratio: [%0.2f] | Location: [%s] Hours: [%i] | Minutes: [%i] | Seconds: [%i]", skin, Float:kill/Float:death, zone, h, m, s);
		SendClientMessage(playerid, COLOR_GREY, string);
		SendClientMessage(playerid, COLOR_GREY, str);
		SendClientMessage(playerid, COLOR_GREY, str2);
		SendClientMessage(playerid, COLOR_GREY, str3);
	}
	else return ErrorMessages(playerid, 1);
	return 1;
}
Reply


Messages In This Thread
godmode in /whois - by suni - 09.07.2015, 22:28
Re: godmode in /whois - by STONEGOLD - 09.07.2015, 22:36
Re: godmode in /whois - by suni - 09.07.2015, 22:44
Re: godmode in /whois - by suni - 09.07.2015, 23:11
Re: godmode in /whois - by suni - 10.07.2015, 19:41
Re: godmode in /whois - by Threshold - 10.07.2015, 20:30
Re: godmode in /whois - by suni - 10.08.2015, 17:51
Re: godmode in /whois - by [LvZ]Free - 10.08.2015, 18:08

Forum Jump:


Users browsing this thread: 4 Guest(s)