Sts dont work
#1

I cant see really what problem is
when i do global textdraw and not player textdraw it work but now it dont work


pawn Код:
CMD:stats(playerid,params[])
{
    new pID;
    if(Dead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
    if(Dead[pID] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command On A Dead Player.");
    if(sscanf(params, "u", pID))
    {
        new string[256];
        format(string, sizeof (string), "~p~%s (%d)", PlayerName(playerid), playerid);
        PlayerTextDrawSetString(playerid, StatsTextDraw2[playerid], string);
        format(string, sizeof (string), "~w~Score: ~g~%d ~n~~w~Kills: ~g~%d ~w~Deaths: ~g~%d ~n~~w~Total Rapes: ~g~%d ~w~Drugs Taken: ~g~%d", GetPlayerScore(playerid), pStats[playerid][Kills], pStats[playerid][Deaths], pStats[playerid][Rapes], pStats[playerid][DrugsTaken]);
        PlayerTextDrawSetString(playerid, StatsTextDraw3[playerid], string);
        format(string, sizeof (string), "~w~Days Alive: ~b~%d Game Days~n~~w~Bonus Kills: ~g~%d ~n~~w~Favorite Skin: ~g~%d", pStats[playerid][DaysPlayed], pStats[playerid][BonusKills], pStats[playerid][FavSkin]);
        PlayerTextDrawSetString(playerid, StatsTextDraw4[playerid], string);
        PlayerTextDrawShow(playerid, StatsTextDraw0[playerid]);
        PlayerTextDrawShow(playerid, StatsTextDraw1[playerid]);
        PlayerTextDrawShow(playerid, StatsTextDraw2[playerid]);
        PlayerTextDrawShow(playerid, StatsTextDraw3[playerid]);
        PlayerTextDrawShow(playerid, StatsTextDraw4[playerid]);
        PlayerTextDrawShow(playerid, StatsTextDraw5[playerid]);
    }
    else
    {
        if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "This Player Is Not Connected.");
        if(Dead[pID] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command On A Dead Player.");

        new string[256];
        format(string, sizeof (string), "~p~%s (%d)", PlayerName(pID), pID);
        PlayerTextDrawSetString(playerid, StatsTextDraw2[playerid], string);
        format(string, sizeof (string), "~w~Score: ~g~%d ~n~~w~Kills: ~g~%d ~w~Deaths: ~g~%d ~n~~w~Total Rapes: ~g~%d ~w~Drugs Taken: ~g~%d", GetPlayerScore(pID), pStats[pID][Kills], pStats[pID][Deaths], pStats[pID][Rapes], pStats[pID][DrugsTaken]);
        PlayerTextDrawSetString(playerid, StatsTextDraw3[playerid], string);
        format(string, sizeof (string), "~w~Days Alive: ~b~%d Game Days~n~~w~Bonus Kills: ~g~%d ~n~~w~Favorite Skin: ~g~%d", pStats[pID][DaysPlayed], pStats[pID][BonusKills], pStats[pID][FavSkin]);
        PlayerTextDrawSetString(playerid, StatsTextDraw4[playerid], string);
        PlayerTextDrawShow(playerid, StatsTextDraw0[playerid]);
        PlayerTextDrawShow(playerid, StatsTextDraw1[playerid]);
        PlayerTextDrawShow(playerid, StatsTextDraw2[playerid]);
        PlayerTextDrawShow(playerid, StatsTextDraw3[playerid]);
        PlayerTextDrawShow(playerid, StatsTextDraw4[playerid]);
        PlayerTextDrawShow(playerid, StatsTextDraw5[playerid]);
    }
    return 1;
}
(if you type only /sts it shows your stats, if you do /sts id then it shows other player sts)
Reply
#2

What do you mean it does not work does it show the textdraw or ?.
Reply
#3

pawn Код:
CMD:stats(playerid,params[])
{
    new pID;
    if(sscanf(params, "u", pID))
        pID = playerid;

    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "This Player Is Not Connected.");
    if(Dead[pID] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command On A Dead Player.");

    new string[256];
    format(string, sizeof (string), "~p~%s (%d)", PlayerName(pID), pID);
    PlayerTextDrawSetString(playerid, StatsTextDraw2[playerid], string);
    format(string, sizeof (string), "~w~Score: ~g~%d ~n~~w~Kills: ~g~%d ~w~Deaths: ~g~%d ~n~~w~Total Rapes: ~g~%d ~w~Drugs Taken: ~g~%d", GetPlayerScore(pID), pStats[pID][Kills], pStats[pID][Deaths], pStats[pID][Rapes], pStats[pID][DrugsTaken]);
    PlayerTextDrawSetString(playerid, StatsTextDraw3[playerid], string);
    format(string, sizeof (string), "~w~Days Alive: ~b~%d Game Days~n~~w~Bonus Kills: ~g~%d ~n~~w~Favorite Skin: ~g~%d", pStats[pID][DaysPlayed], pStats[pID][BonusKills], pStats[pID][FavSkin]);
    PlayerTextDrawSetString(playerid, StatsTextDraw4[playerid], string);
    PlayerTextDrawShow(playerid, StatsTextDraw0[playerid]);
    PlayerTextDrawShow(playerid, StatsTextDraw1[playerid]);
    PlayerTextDrawShow(playerid, StatsTextDraw2[playerid]);
    PlayerTextDrawShow(playerid, StatsTextDraw3[playerid]);
    PlayerTextDrawShow(playerid, StatsTextDraw4[playerid]);
    PlayerTextDrawShow(playerid, StatsTextDraw5[playerid]);
    return 1;
}
try this, if it still doesn't show, then you probably made errors in creating the textdraws
Reply
#4

Same.... =/
Reply


Forum Jump:


Users browsing this thread: