24.10.2014, 22:15
/information and /inv isn't responding when i do /inv in while in game it dosn't do anything so let me know the fixes please!
Information Cmd
inventory command!
Information Cmd
PHP код:
dcmd_i(playerid, params[])
{
if(isnull(params)) //HIMSELF
{
new current_zone;
current_zone = player_zone[playerid];
new stringer[20];
if(!IsPlayerInAnyVehicle(playerid)) { format(stringer,sizeof(stringer),"~w~On Foot"); }
if(IsPlayerInAnyVehicle(playerid)) { format(stringer,sizeof(stringer),"~w~In Service In A ~g~%s",VehiclesName[GetPlayerVehicleID(playerid) - 400]); }
if(gTeam[playerid] == TEAM_COPS)
{
new string[1500];
format(string,sizeof(string),",~p~%s(%d), ,~w~Skill: ~b~%s,~b~Level %d - Rank: %s, ,~w~Location: ~p~%s (%s), %s, ,~w~Press ~y~LMB ~w~To Cancel This Box",UserStats[playerid][Name],playerid,GetTeamName(playerid),UserStats[playerid][PoliceRank],GetPoliceStringRankName(playerid),zones[current_zone][zone_name],GetPlayerDirectionFromPlayer(playerid,playerid),stringer);
ShowTextdrawInfoBox(playerid, 60,"~b~Player Information",string);
}
if(gTeam[playerid] == TEAM_CIVIL)
{
new string[1500];
format(string,sizeof(string),",~p~%s(%d), ,~w~Skill: ~b~%s,~b~Level %d - Rank: %s, ,~w~Location: ~p~%s (%s), %s, ,~w~Press ~y~LMB ~w~To Cancel This Box",UserStats[playerid][Name],playerid,GetTeamName(playerid),UserStats[playerid][PoliceRank],GetPoliceStringRankName(playerid),zones[current_zone][zone_name],GetPlayerDirectionFromPlayer(playerid,playerid),stringer);
ShowTextdrawInfoBox(playerid, 60,"~b~Player Information",string);
}
}
if(!isnull(params))
{
new id;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "Usage: /i (id/nick)");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, RTNUSRNoResults);
if(id == -1) return SendClientMessage(playerid,COLOR_RED,RTNUSRNoResults);
new current_zone;
current_zone = player_zone[id];
new stringer[20];
if(!IsPlayerInAnyVehicle(id)) { format(stringer,sizeof(stringer),"~w~On Foot"); }
if(IsPlayerInAnyVehicle(id)) { format(stringer,sizeof(stringer),"~w~In Service In A ~g~%s",VehiclesName[GetPlayerVehicleID(playerid) - 400]); }
if(gTeam[id] == TEAM_COPS)
{
new string[1500];
format(string,sizeof(string),",~p~%s(%d), ,~w~Skill: ~b~%s,~b~Level %d - Rank: %s, ,~w~Location: ~p~%s (%s), %s, ,~w~Press ~y~LMB ~w~To Cancel This Box",UserStats[id][Name],id,GetTeamName(id),UserStats[id][PoliceRank],GetPoliceStringRankName(id),zones[current_zone][zone_name],GetPlayerDirectionFromPlayer(playerid,id),stringer);
ShowTextdrawInfoBox(playerid, 60,"~b~Player Information",string);
}
if(gTeam[playerid] == TEAM_CIVIL)
{
new string[1500];
format(string,sizeof(string),",~p~%s(%d), ,~w~Skill: ~b~%s,~b~Level %d - Rank: %s, ,~w~Location: ~p~%s (%s), %s, ,~w~Press ~y~LMB ~w~To Cancel This Box",UserStats[playerid][Name],playerid,GetTeamName(playerid),UserStats[playerid][PoliceRank],GetPoliceStringRankName(playerid),zones[current_zone][zone_name],GetPlayerDirectionFromPlayer(playerid,playerid),stringer);
ShowTextdrawInfoBox(playerid, 60,"~b~Player Information",string);
}
}
return 1;
}
PHP код:
dcmd_inv(playerid, params[])
{
#pragma unused params
if(UserStats[playerid][Spawned] == 0) return SendClientMessage(playerid,COLOR_RED,OnlyAlive);
if(UserStats[playerid][ChoosingSkill] != 0) return SendClientMessage(playerid,COLOR_RED,"You cannot use this command!");
new LifeInsuranceString[20],HealthInsuranceString[20];
if(UserStats[playerid][LifeInsurance] >= 1) { format(LifeInsuranceString,sizeof(LifeInsuranceString),"~g~YES ~w~- %d",UserStats[playerid][LifeInsurance]); }
if(UserStats[playerid][LifeInsurance] == 0) { format(LifeInsuranceString,sizeof(LifeInsuranceString),"~r~NONE"); }
if(UserStats[playerid][HealthInsurance] >= 1) { format(HealthInsuranceString,sizeof(HealthInsuranceString),"~g~YES ~w~- %d",UserStats[playerid][HealthInsurance]); }
if(UserStats[playerid][HealthInsurance] == 0) { format(HealthInsuranceString,sizeof(HealthInsuranceString),"~r~NONE"); }
if(gTeam[playerid] == TEAM_CIVIL || gTeam[playerid] == TEAM_COPS)
{
new string[1500];
format(string,sizeof(string),",~w~Cash: ~p~$%d ~w~Bank: ~p~$%d, ,~w~Life Insurance: %s,~w~Health Insurance: %s, ,~w~Secure Wallet: %s ~w~Secure Pants: %s, ,~w~Condoms: ~p~%d ~w~Donuts: ~p~%d, ,~w~Press ~y~LMB ~w~To Cancel This Box",PlayerCash[playerid],UserStats[playerid][BankCash],LifeInsuranceString,HealthInsuranceString,"~r~NO","~r~NO",UserStats[playerid][Condoms],UserStats[playerid][Donuts]);
ShowTextdrawInfoBox(playerid, 60,"~b~Inventory",string);
}
return 1;
}