Kill, Death and server Visit counter doesn't work out for me!
#7

Quote:
Originally Posted by FarSe.
Посмотреть сообщение
Do you load/save the data from/to 'user file'?
Yes and that works well.

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Try:
pawn Код:
//At the top
enum pInfo
{
    pKills,
    pDeaths,
    pVisits
}
new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerConnect(playerid)
{
    PlayerInfo[playerid][pVisits]++;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][pKills]++;
    PlayerInfo[playerid][pDeaths]++;
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/stats", cmdtext, true, 10) == 0)//test cmd
    {
       if(IsPlayerConnected(playerid))
       {
           new statstring[128];
           format(statstring, sizeof(statstring), "| Your Stats | Kills: %d | Deaths: %d | Visits: %d |",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pVisits]);
           SendClientMessage(playerid,-1, statstring);
       }
       return 1;
    }
    return 0;
}
This works well on clean script and that is exectly what I have. Gonna go trought my script step by step.
Thanks for help.





Okay... Everything seems to be alright with my script, but there is still problem. It doesn't count my logins.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 6 Guest(s)