/checkplayer command!
#1

Hello, I want to /checkplayer command which show all players weapons and money and health and armour. I have no idea how it will be made.
Thank You.
Reply
#2

Код:
dcmd_getinfo(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
	{
	    if(!strlen(params)) return
		SendClientMessage(playerid, LIGHTBLUE2, "Usage: /getinfo [PlayerID] ") &&
		SendClientMessage(playerid, orange, "Function: Will see Informations of specified player");
	    new player1;
		new string[128];
	    player1 = strval(params);

	 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
		 {
			new TimesOn;
			new pIP[128];
		    new Float:pHealth;
			new Float:pArmour;
			new year,month,day;
			new pn,Sum, Average;
			new tmp2[256],file[256];
			new Float:x,Float:y,Float:z;
			new pRegister[4],RegDate[256];
			new pJailed[4],pFrozen[4];
			new pInCage[4], pLogged[4];
			new LuX_GpsZone[MAX_ZONE_NAME] = "Undetected Zone!";
			
			GetPlayerArmour(player1,pArmour);
			GetPlayerHealth(player1,pHealth);
	    	GetPlayerIp(player1, pIP, sizeof(pIP));
	    	getdate(year, month, day);
	    	GetPlayerPos(player1,x,y,z);
			GetPlayerInZone(player1, LuX_GpsZone, MAX_ZONE_NAME);
			
			format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(PlayerName2(player1)));

			if(AccInfo[player1][Jailed] == 1)   pJailed   = "Yes"; else pJailed   = "No";
			if(AccInfo[player1][Frozen] == 1) 	pFrozen   = "Yes"; else pFrozen   = "No";
			if(AccInfo[player1][pCaged] == 1) 	pInCage   = "Yes"; else pInCage   = "No";
			if(AccInfo[player1][LoggedIn] == 1) pLogged   = "Yes"; else pLogged   = "No";
			if(fexist(file))				    pRegister = "Yes"; else pRegister = "No";
			
			if(dUserINT(PlayerName2(player1)).("LastOn")==0)
			tmp2 = "Never";
			else tmp2 = dini_Get(file,"LastOn");
			
			if(strlen(dini_Get(file,"RegisteredDate")) < 3)
			RegDate = "n/a";
			else RegDate = dini_Get(file,"RegisteredDate");
			
			TimesOn = dUserINT(PlayerName2(player1)).("TimesOnServer");

			while (pn < PING_MAX_EXCEEDS){
			Sum += AccInfo[player1][pPing][pn]; pn++;
			}
			Average = (Sum / PING_MAX_EXCEEDS);
 			if(IsPlayerAdmin(player1)) AdmRank = "RCON Administrator";
	    	else
 			switch(AccInfo[player1][Level])
			{
			case 1: AdmRank = "Basic Moderator";
			case 2: AdmRank = "Moderator";
			case 3: AdmRank = "Master Moderator";
			case 4: AdmRank = "Administrator";
			case 5: AdmRank = "Master Administrator";
			}
			if(AccInfo[playerid][Level] > 5)
			{
			AdmRank = "Professional Admin";
			}
			SendClientMessage(playerid, orange, " ");
 			SendClientMessage(playerid, orange, "___________ |- Player Information -| ___________");
	  		format(string, sizeof(string),"Name: %s | ID: %d | Ip: %s | Health: %d | Armour: %d | Cash: %d", PlayerName2(player1),player1,pIP,floatround(pHealth),floatround(pArmour),GetPlayerMoney(player1));
			SendClientMessage(playerid,LIGHTGREEN,string);
		  	format(string, sizeof(string),"Score: %d | Skin: %d | Ping: %d (Average: %d) | Wanted Level: %d", GetPlayerScore(player1),GetPlayerSkin(player1),GetPlayerPing(player1),Average,GetPlayerWantedLevel(player1));
			SendClientMessage(playerid,0x33F666FF,string);
			format(string, sizeof(string),"Interior: %d | Virtual World: %d | Pos: X: %0.1f, Y: %0.1f, Z: %0.1f | In: %s", GetPlayerInterior(player1), GetPlayerVirtualWorld(player1), Float:x,Float:y,Float:z,LuX_GpsZone);
			SendClientMessage(playerid,0x53D266FF,string);
			format(string, sizeof(string),"Kills: %d | Deaths: %d | Ratio: %0.2f | Admin Level: %d - %s | In Cage: %s", AccInfo[player1][Kills],AccInfo[player1][Deaths],Float:AccInfo[player1][Kills]/Float:AccInfo[player1][Deaths],AccInfo[player1][Level],AdmRank,pInCage);
			SendClientMessage(playerid,0x53D212FF,string);
			format(string, sizeof(string),"Registered: %s | Logged In: %s | In Jail: %s | Frozen: %s | On Server: %d",pRegister,pLogged,pJailed,pFrozen,TimesOn);
			SendClientMessage(playerid,0x53BB12FF,string);
			format(string, sizeof(string),"Last On Server: %s | Register Date: %s | Todays Date: %d/%d/%d",tmp2,RegDate,day,month,year);
			SendClientMessage(playerid,0x129E12FF,string);

			if(IsPlayerInAnyVehicle(player1))
			{
			new Float:VHealth, carid = GetPlayerVehicleID(playerid);
			GetVehicleHealth(carid,VHealth);
			format(string, sizeof(string),"Vehicle Name: %s | VehicleID: %d | Model: %d | Vehicle Health: %d",VehicleNames[GetVehicleModel(carid)-400],carid,GetVehicleModel(carid),floatround(VHealth));
			SendClientMessage(playerid,0x12B281FF,string);
			}

			new slot, ammo, weap, Count, WeapName[24], WeapSTR[128], p; WeapSTR = "Weapons: ";
			for (slot = 0; slot < 14; slot++)
			{
			GetPlayerWeaponData(player1, slot, weap, ammo);
			if( ammo != 0 && weap != 0)
			Count++;
			}
			if(Count < 1)
			return SendClientMessage(playerid,0x6BF686FF,"Player has no weapons");
			else
			{
				for (slot = 0; slot < 14; slot++)
				{
					GetPlayerWeaponData(player1, slot, weap, ammo);
					if (ammo > 0 && weap > 0)
					{
						GetWeaponName(weap, WeapName, sizeof(WeapName) );
						if (ammo == 65535 || ammo == 1)
						format(WeapSTR,sizeof(WeapSTR),"%s%s (1)",WeapSTR, WeapName);
						else format(WeapSTR,sizeof(WeapSTR),"%s%s (%d)",WeapSTR, WeapName, ammo);
						p++;
						if(p >= 5)
						{
						SendClientMessage(playerid, 0x6BF686FF, WeapSTR); format(WeapSTR, sizeof(WeapSTR), "Weapons: "); p = 0;
						}
						else format(WeapSTR, sizeof(WeapSTR), "%s,  ", WeapSTR);
					}
				}
				if(p <= 4 && p > 0)
				{
					string[strlen(string)-3] = '.';
				    SendClientMessage(playerid, 0x6BF686FF, WeapSTR);
				}
			}
			return 1;
		}
		else return ErrorMessages(playerid, 2);
	}
	else return  ErrorMessages(playerid, 7);
}
Here It Is Dont Forget To +repp
Reply
#3

You have taken this from another registration system. I want a simple which can fit on every admin system. Just show the available guns.
Reply
#4

here dude try it

Код:
if(strcmp("/getinfo", cmd, true) == 0)
	{
		new tmp[256], cmdid;
		tmp = strtok(cmdtext, idx);
		if(GetPlayerLevel(playerid) < 1) return SendClientMessage(playerid, red, "You are not permitted to use this");
		if(!strlen(tmp)) return SendClientMessage(playerid, red, "You did not put in an id");
		if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, red, "That player is not connected");
		cmdid = strval(tmp);

		new oname[MAX_PLAYER_NAME];
		GetPlayerName(cmdid, oname, sizeof(oname));

		new string[256];

		SendClientMessage(playerid, green, "===INFO===");

		format(string, sizeof(string), "Name: %s", oname);
		SendClientMessage(playerid, green, string);

		format(string, sizeof(string), "ID: %d", cmdid);
		SendClientMessage(playerid, green, string);

		format(string, sizeof(string), "Cash: %d", GetPlayerMoney(cmdid));
		SendClientMessage(playerid, green, string);

		format(string, sizeof(string), "Score: %d", GetPlayerScore(cmdid));
		SendClientMessage(playerid, green, string);

		format(string, sizeof(string), "Kills: %d", dUserINT(PlayerName(playerid)).("kills"));
		SendClientMessage(playerid, green, string);
		
		format(string, sizeof(string), "Deaths: %d", dUserINT(PlayerName(playerid)).("deaths"));
		SendClientMessage(playerid, green, string);
}
}
return 1;
}
Reply
#5

dEcooR, It is like showing stats. I want a command for admin from which admins can see his name his score his cash and his weapons. Please Any one?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)