06.06.2015, 15:55
Код:
COMMAND:i(playerid, params[]) { return cmd_info(playerid, params); } COMMAND:info(playerid, params[]) { new string[256], giveplayerid; new vehicleid = GetPlayerVehicleID(giveplayerid); new modelid = GetVehicleModel(giveplayerid); if (sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_ERROR, "USAGE: /info [Playerid]"); new Levelstr[256], Locstr[256], vstr[256]; if (!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "%d Is Not A Valid ID.", giveplayerid); SendClientMessage(playerid, COLOR_ERROR, string); return 1; } if (PlayerInfo[giveplayerid][pTeam] == TEAM_LAW || PlayerInfo[giveplayerid][pVigilante] == 1) { format(Levelstr, sizeof(Levelstr), "~b~Level %d Rank: %s",PlayerInfo[giveplayerid][pLevel],PoliceRanks[PlayerInfo[giveplayerid][pRank]]); } else { switch (PlayerInfo[giveplayerid][pWantedLevel]) { case 0:format(Levelstr, sizeof(Levelstr), "~w~Wanted Level %d Innocent Civilian",PlayerInfo[giveplayerid][pWantedLevel]); case 1..5:format(Levelstr, sizeof(Levelstr), "~y~Wanted Level %d",PlayerInfo[giveplayerid][pWantedLevel]); case 6..9:format(Levelstr, sizeof(Levelstr), "~r~Wanted Level %d",PlayerInfo[giveplayerid][pWantedLevel]); case 10:format(Levelstr, sizeof(Levelstr), "~r~Wanted Level %d Most Wanted",PlayerInfo[giveplayerid][pWantedLevel]); } } if (PlayerInfo[giveplayerid][pSpawn] == 0) { Locstr = "~r~Dead in Whole Somewhere"; } else if (PlayerInfo[giveplayerid][pSpecID] > -1 || PlayerInfo[giveplayerid][AdminDuty] == 1) { Locstr = "~p~San Andreas"; } else { format(Locstr, sizeof(Locstr), "~p~%s",PlayerInfo[giveplayerid][pLocation]); } if (IsPlayerInVehicle(giveplayerid,vehicleid)) { format(vstr, sizeof(vstr), "~p~In %s",aVehicleNames[modelid - 400]); } else { vstr = "~p~On Foot"; } if (PlayerInfo[giveplayerid][pTeam] == TEAM_LAW) { HideAllServerTextDraws(playerid); HideTextDrawMenu(playerid); format(string, sizeof(string), "~g~Player Information~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_"); TextDrawSetString(InfoTD0, string); format(string, sizeof(string), "~b~%s (%d)~n~~n~~w~Skill: ~b~%s~n~%s~n~~n~~w~Location:~n~%s~n~~w~%s", PlayerInfo[giveplayerid][pName],giveplayerid, SkillNames[PlayerInfo[giveplayerid][pSkill]], Levelstr, Locstr, vstr); TextDrawSetString(InfoTD1, string); format(string, sizeof(string), "Press~y~ LMB~w~ To Close The Box"); TextDrawSetString(InfoTD2, string); TextDrawShowForPlayer(playerid, InfoTD0); TextDrawShowForPlayer(playerid, InfoTD1); TextDrawShowForPlayer(playerid, InfoTD2); } else { HideAllServerTextDraws(playerid); HideTextDrawMenu(playerid); format(string, sizeof(string), "~g~Player Information~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_"); TextDrawSetString(InfoTD0, string); format(string, sizeof(string), "~b~%s (%d)~n~~n~~w~Skill:~g~ %s~n~~n~%s~n~~w~Location: ~n~%s~n~~w~%s", PlayerInfo[giveplayerid][pName], giveplayerid, SkillNames[PlayerInfo[giveplayerid][pSkill]], Levelstr, Locstr, vstr); TextDrawSetString(InfoTD1, string); format(string, sizeof(string), "Press~y~ LMB~w~ To Close The Box"); TextDrawSetString(InfoTD2, string); TextDrawShowForPlayer(playerid, InfoTD0); TextDrawShowForPlayer(playerid, InfoTD1); TextDrawShowForPlayer(playerid, InfoTD2); } return 0; }