Help,/stats
#1

Hello everyone,
I made this script,but when i type /stats it dosen't show
pawn Код:
public ShowStats(playerid)
{
    new string[128];
    new alevel = PlayerInfo[playerid][pAdminLevel];
    new Cash = PlayerInfo[playerid][pCash];
    new Score = PlayerInfo[playerid][pScore];
    new flights = PlayerInfo[playerid][pFlights];
   
    new pilotrank[20];
    if(PlayerInfo[playerid][pPilot] == 1){ pilotrank = "General Pilot"; }
    else if(PlayerInfo[playerid][pPilot] == 2){ pilotrank = "Co-Pilot"; }
    else if(PlayerInfo[playerid][pPilot] == 3){ pilotrank = "Stewart"; }
   
    new destination[128];
    if(PlayerInfo[playerid][pDestination] == 1){ destination = "Los Santos International Airport"; }
    else if(PlayerInfo[playerid][pDestination] == 2){ destination = "Las Venturas International Airport"; }
    else if(PlayerInfo[playerid][pDestination] == 3){ destination = "San Fierro International Airport"; }
    else if(PlayerInfo[playerid][pDestination] == 4){ destination = "Las Venturas Desert Airport"; }
   
    new atcrank[22];
    if(PlayerInfo[playerid][pAtcPlayer] == 1){ destination = "Lead Atc"; }
    else if(PlayerInfo[playerid][pAtcPlayer] == 2){ destination = "Atc Sergeant"; }

    SendClientMessage(playerid,COLOR_GREEN,"|____________________Your Stats : %s(%d)_____________________|");
    format(string, sizeof(string),"Account Stats: Admin Level:%d    Money:%d    Score:%d",alevel,Cash,Score);
    SendClientMessage(playerid,COLOR_GREEN,string);
    format(string, sizeof(string),"Pilot Stats: Flights:%d  Current Destination:%s  Pilot Rank:%s",flights,destination,pilotrank);
    SendClientMessage(playerid,COLOR_GREEN,string);
    format(string, sizeof(string),"ATC Stats: ATC Rank:%s",atcrank);
    SendClientMessage(playerid,COLOR_GREEN,string);
    return 1;
}
And here is the command:
pawn Код:
if (strcmp(cmd, "/stats", true) == 0)
    {
            if (gPlayerLogged[playerid] != 0)
                {
                    ShowStats(playerid);
                }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   You are not Logged in!");
                return 1;
            }
            return 1;
    }
Reply
#2

So does it say you're not logged in or does it do absolutely nothing ?
Reply
#3

Quote:
Originally Posted by dice7
Посмотреть сообщение
So does it say you're not logged in or does it do absolutely nothing ?
absolutelly nothing
Reply
#4

Not even "Unknown command" ?
Also try debugging your code (adding some printfs in your command and function) so you know to where it gets executed if it even gets.
Reply
#5

showstats not lag?
Reply
#6

Ok,but i took a look in Raven's RolePlay,and there is something like this

pawn Код:
ShowStats(playerid,playerid);
pawn Код:
public ShowStats(playerid,targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        new cash =  GetPlayerMoney(targetid);
        new atext[20];
        if(PlayerInfo[targetid][pSex] == 1) { atext = "Male"; }
        else if(PlayerInfo[targetid][pSex] == 2) { atext = "Female"; }
        new otext[20];
        if(PlayerInfo[targetid][pOrigin] == 1) { otext = "America"; }
        else if(PlayerInfo[targetid][pOrigin] == 2) { otext = "Europe"; }
        else if(PlayerInfo[targetid][pOrigin] == 3) { otext = "Asia"; }
        else if(PlayerInfo[targetid][pOrigin] == 4) { otext = "Africa"; }
.
.
.
.
.

        format(coordsstring, sizeof(coordsstring),"|_________________________________________________| %s (%d) |_________________________________________________|",name, targetid);
        SendClientMessage(playerid, COLOR_GREEN,coordsstring);
        format(coordsstring, sizeof(coordsstring), "| Level: %d | Sex: %s | Age: %d | Cash: $%d | Bank: $%d | Ph: %d |Phone Type: %s | Regular Rank: %s |", level,atext,age,cash,account,pnumber,PType,drank);
        SendClientMessage(playerid, COLOR_GRAD1,coordsstring);
        format(coordsstring, sizeof(coordsstring), "| Total Playing Hours: %d | Total Playing Mins: %d | Total Playing Secs: %d | BiggestFish: %d | TimesArrested: %d |",(ptime / 3600), (ptime / 60), ptime,bigfish,arrests);
        SendClientMessage(playerid, COLOR_GRAD1,coordsstring);
        format(coordsstring, sizeof(coordsstring), "| Respect: %d/%d | Deaths: %d | Drugs: %d | Materials: %d | Team: %s | Rank: %s | Kills: %d | Warnings: %d |",exp,expamount,Deaths,drugs,mats,ttext,rtext, Kills,warned);
        SendClientMessage(playerid, COLOR_GRAD1,coordsstring);
        format(coordsstring, sizeof(coordsstring), "| Swat Rank: %s | Tactical Rank: %s | Forces Rank: %s | DD Manager: %d | LottoNr: %d | Crimes: %d |",swatr,tacticalr,specialfr,drights,lotto,crimes);
        SendClientMessage(playerid, COLOR_GRAD1,coordsstring);
        format(coordsstring, sizeof(coordsstring), "| Fighting: %s | Tester Rank: %d | ColtSkill: %d | Silenced Skill: %d | Deagle Skill: %d | Shotgun Skill: %d |",fight, tester, Colt,Silenced,Deagle, Shotgun);
        SendClientMessage(playerid, COLOR_GRAD1,coordsstring);
        format(coordsstring, sizeof(coordsstring), "| SawnSkill: %d | Combat Skill: %d | Uzi Skill: %d | SMG Skill: %d | M4 Skill: %d | AK-47 Skill: %d |", Sawn,Combat,Uzi, Smg, M4, Ak47);
        SendClientMessage(playerid, COLOR_GRAD1,coordsstring);
        format(coordsstring, sizeof(coordsstring), "| Health: %.1f | Armour: %.1f | IP: %s | Fishes: %d | Last Leaving: %s | Duty Banned: %d |", health, armour, Playersip, fishes, PlayerInfo[targetid][pWhyLeft], dban);
        SendClientMessage(playerid, COLOR_GRAD1,coordsstring);
        format(coordsstring, sizeof(coordsstring), "| House key: %d | Business key: %d | HireKey: %d | Interior: %d | Virtual World: %d | Local: %d | Job: %s |", housekey,bizkey,HireCar[targetid],intir,virworld,local,jtext);
        SendClientMessage(playerid, COLOR_GRAD1,coordsstring);
        if (PlayerInfo[targetid][pPcarkey] != 999)
        {
            new vehiclename[24];
            GetVehicleName(carkey, vehiclename, sizeof(vehiclename));
            format(coordsstring, sizeof(coordsstring), "| CarID: %d | Model: %s (%d) | VehValue: %d | VehColor1: %d | VehColor2: %d | VehLocked: %d |",carkey,vehiclename, CarInfo[carkey][cModel], GetVehiclePrice(carkey), CarInfo[carkey][cColorOne], CarInfo[carkey][cColorTwo], CarInfo[carkey][cLock]);
            SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
        }
        if (PlayerInfo[targetid][pPcarkey2] != 999)
        {
            new vehiclename[24];
            GetVehicleName(carkey2, vehiclename, sizeof(vehiclename));
            format(coordsstring, sizeof(coordsstring), "| CarID: %d | Model: %s (%d) | VehValue: %d | VehColor1: %d | VehColor2: %d | VehLocked: %d |",carkey2,vehiclename, CarInfo[carkey2][cModel], GetVehiclePrice(carkey2), CarInfo[carkey2][cColorOne], CarInfo[carkey2][cColorTwo], CarInfo[carkey2][cLock]);
            SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
        }
    }
}

There is a targetid,but for what?
Reply
#7

Anyone please?I need it fast
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)