SA-MP Forums Archive
/stats - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /stats (/showthread.php?tid=129453)



/stats - Julian2574 - 22.02.2010

I messed up my /stats and don't know how to fix this mess right now I prob could fix it but who knows? That's why I am asking for help:
/STATS:
pawn Код:
if (strcmp(cmd, "/stats", true) == 0)
    {
          if(IsPlayerConnected(playerid))
      {
        new cash = GetPlayerMoney(playerid);
    //new admin = PlayerInfo[playerid][pAdmin];
    new level = PlayerInfo[playerid][pLevel];
    new exp = PlayerInfo[playerid][pExp];
    new gun1 = PlayerInfo[playerid][pGun1];
    new gun2 = PlayerInfo[playerid][pGun2];
    new gun3 = PlayerInfo[playerid][pGun3];
    new gun4 = PlayerInfo[playerid][pGun4];
    new gun5 = PlayerInfo[playerid][pGun5];
    new gun6 = PlayerInfo[playerid][pGun6];
    new ammo1 = PlayerInfo[playerid][pAmmo1];
    new ammo2 = PlayerInfo[playerid][pAmmo2];
    new ammo3 = PlayerInfo[playerid][pAmmo3];
    new ammo4 = PlayerInfo[playerid][pAmmo4];
    new ammo5 = PlayerInfo[playerid][pAmmo5];
    new ammo6 = PlayerInfo[playerid][pAmmo6];
    new kills = PlayerInfo[playerid][pKills];
    //new pcb = PlayerInfo[playerid][pCB];
    //new phw = PlayerInfo[playerid][pHW];
    //new psr = PlayerInfo[playerid][pSR];
    //new pwa = PlayerInfo[playerid][pWA] ;
    //new ppen = PlayerInfo[playerid][pPEN];
    new pnumber = PlayerInfo[playerid][pPnumber];
    new account = PlayerInfo[playerid][pAccount];
    new nxtlevel = PlayerInfo[playerid][pLevel]+1;
    new expamount = nxtlevel*levelexp;
    //new costlevel = nxtlevel*levelcost;//10k for testing purposes
    new housekey = PlayerInfo[playerid][pPhousekey];
    new bizkey = PlayerInfo[playerid][pPbiskey];
    new intir = PlayerInfo[playerid][pInt];
    new local = PlayerInfo[playerid][pLocal];
    new Float:shealth = PlayerInfo[playerid][pSHealth];
    new Float:health;
    new name[MAX_PLAYER_NAME];
    new sgun1[20];
    new sgun2[20];
    new sgun3[20];
    new sgun4[20];
    new sgun5[20];
    new sgun6[20];
    GetWeaponName(gun1, sgun1, 20);
    GetWeaponName(gun2, sgun2, 20);
    GetWeaponName(gun3, sgun3, 20);
    GetWeaponName(gun4, sgun4, 20);
    GetWeaponName(gun5, sgun5, 20);
    GetWeaponName(gun6, sgun6, 20);
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerHealth(playerid,health);
    new Float:px,Float:py,Float:pz;
    GetPlayerPos(playerid, px, py, pz);
    new coordsstring[256];
    SendClientMessage(playerid, COLOR_GREEN,"_________________STATS:%s_________________",name);
    format(coordsstring, sizeof(coordsstring), "PlayerLevel: [%d] SpawnHealth: %.1f Cash: [$%d] Bank: [$%d] Ph: [%d]", level, shealth+50, cash, account, pnumber);
    SendClientMessage(playerid, COLOR_GRAD1,coordsstring);
    format(coordsstring, sizeof(coordsstring), "Weapons: %s %s %s %s %s %s", sgun1,sgun2,sgun3,sgun4,sgun5,sgun6);
    SendClientMessage(playerid, COLOR_GRAD2,coordsstring);
    format(coordsstring, sizeof(coordsstring), "Ammo1: [%d] Ammo2: [%d] Ammo3: [%d] Ammo4: [%d] Ammo5: [%d] Ammo6: [%d]", ammo1,ammo2,ammo3,ammo4,ammo5,ammo6);
    SendClientMessage(playerid, COLOR_GRAD3,coordsstring);
    if (stats)
    {
        format(coordsstring, sizeof(coordsstring), "KILLS/EXP ");
        SendClientMessage(playerid, COLOR_GRAD4,coordsstring);
        format(coordsstring, sizeof(coordsstring), "Kills: [%d] Exp: [%d/%d]",kills,exp,expamount);
        SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
        /*
        if(expamount <= exp)
        {
            SendClientMessage(playerid, COLOR_RED,coordsstring);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
        }*/

       
    }
    if (IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
    {
        format(coordsstring, sizeof(coordsstring), "House key [%d] Business key [%d] HireKey [%d] int:[%d] local[%d]", housekey,bizkey,HireCar[targetid],intir,local);
        SendClientMessage(playerid, COLOR_GRAD6,coordsstring);
    }
    //SendClientMessage(playerid, COLOR_GRAD6,"Hint: use /level <playerid> to see another players stats");
    SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
}
            }
        else
        {
        SendClientMessage(playerid, COLOR_GRAD1, "You are not logged in");
        }
    }
        return 1;
    }



Re: /stats - aircombat - 22.02.2010

does it give errors or doesnt work or what??
________
Side effects of depakote


Re: /stats - MenaceX^ - 22.02.2010

Quote:
Originally Posted by [AC
Etch ]
does it give errors or doesnt work or what??
+1, no info about the problem..


Re: /stats - Rizard - 22.02.2010

Quote:
Originally Posted by »Julian™«
I messed up my /stats
...

+1


Re: /stats - Julian2574 - 22.02.2010

Quote:
Originally Posted by [AC
Etch ]
does it give errors or doesnt work or what??
It gives error , Crashes my Pawn but I used then Showstats(playerid,playerid); and it compiled fine the tricky part is when I go and do /stats IG it crashes the serv.


Re: /stats - aircombat - 22.02.2010

can u show the errors
________
Fix ps3


Re: /stats - Julian2574 - 22.02.2010

[quote=»Julian™« ]
Quote:
Originally Posted by [AC
Etch ]
does it give errors or doesnt work or what??
Quote:
Originally Posted by »Julian™«
Crashes my Pawn
Read my post a bit better else 1+ to me.