Untitled

mail@pastecode.io avatar
unknown
plain_text
9 days ago
1.9 kB
1
Indexable
Never
CMD:id(playerid, params[]) {
	if(isnull(params)) {
		return SendClientMessageEx(playerid, COLOR_GREY, "SU DUNG: /id [player name]");
	}

	new
		szMessage[128],
		szPlayerName[MAX_PLAYER_NAME],
		iTargetID = strval(params);

	if(IsNumeric(params) && IsPlayerConnected(strval(params)))
	{
		new client[128];
		if(GetPVarInt(iTargetID, "NotAndroid") == 0) 
			format(client, sizeof(client), "Mobile");
    	else 
    		format(client, sizeof(client), "PC");

	    if(PlayerInfo[playerid][pAdmin] >= 2) format(szMessage, sizeof szMessage, "%s (ID: %d) - (Cap do: %d) - (Ping: %d) - (FPS: %d) - (%s)", GetPlayerNameEx(iTargetID), iTargetID, PlayerInfo[iTargetID][pLevel], GetPlayerPing(iTargetID), pFPS[iTargetID], client);
		else format(szMessage, sizeof szMessage, "%s (ID: %d) - (Level: %d) - (Ping: %d) - (%s)", GetPlayerNameEx(iTargetID), iTargetID, PlayerInfo[iTargetID][pLevel], GetPlayerPing(iTargetID), client);
		return SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
	}
	else if(strlen(params) < 3) {
		return SendClientMessageEx(playerid, COLOR_GREY, "Ten nguoi tim kiem it nhat phai 3 ki tu.");
	}
	else foreach(new i: Player)
	{
		new client[128];
		if(GetPVarInt(i, "NotAndroid") == 0) 
			format(client, sizeof(client), "Mobile");
    	else 
    		format(client, sizeof(client), "PC");
    	
		GetPlayerName(i, szPlayerName, sizeof szPlayerName);
		if(strfind(szPlayerName, params, true) != -1) {
			if(PlayerInfo[playerid][pAdmin] >= 2) format(szMessage, sizeof szMessage, "%s (ID: %d) - (Cap do: %d) - (Ping: %d) - (FPS: %d) - (%s)", GetPlayerNameEx(i), i, PlayerInfo[i][pLevel], GetPlayerPing(i), pFPS[i], client);
			else format(szMessage, sizeof szMessage, "%s (ID: %d) - (Cap do: %d) - (Ping: %d) - (%s)", GetPlayerNameEx(i), i, PlayerInfo[i][pLevel], GetPlayerPing(i), client);
			SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
		}
	}
	return 1;
}
Leave a Comment