Commands Prob !!
#1

/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
PHP код:
dcmd_i(playeridparams[])
{
    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(playerid60,"~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(playerid60,"~b~Player Information",string);
        }
    }
    if(!
isnull(params))
    {
        new 
id;
        if(
sscanf(params"u"id)) return SendClientMessage(playeridCOLOR_RED"Usage: /i (id/nick)");
        if(!
IsPlayerConnected(id)) return SendClientMessage(playeridCOLOR_REDRTNUSRNoResults);
        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(playerid60,"~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(playerid60,"~b~Player Information",string);
        }
    }
    return 
1;

inventory command!

PHP код:
dcmd_inv(playeridparams[])
{
    
#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(playerid60,"~b~Inventory",string);
    }
    return 
1;

Reply
#2

Really? This needs optimising, you're using an extremely old script of mine which is heavily outdated.
Reply
#3

Do any error comes
Reply
#4

Quote:

Do any error comes

No! so can anybody help me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)