26.09.2011, 22:46
Try this version:
pawn Code:
new Text:Coisa[MAX_PLAYERS];
public OnGameModeInit()
{
SetTimer("Killstreak", 5000, true);
return 1;
}
public OnPlayerConnect(playerid)
{
Coisa[playerid] = TextDrawCreate(160.000000, 360.000000, "__");
TextDrawBackgroundColor(Coisa[playerid], 255);
TextDrawFont(Coisa[playerid], 1);
TextDrawLetterSize(Coisa[playerid], 0.300000, 1.000000);
TextDrawColor(Coisa[playerid], -1);
TextDrawSetOutline(Coisa[playerid], 1);
TextDrawSetProportional(Coisa[playerid], 1);
TextDrawUseBox(Coisa[playerid], 0);
TextDrawBoxColor(Coisa[playerid], 255);
TextDrawTextSize(Coisa[playerid], 620.000000, 0.000000);
TextDrawShowForPlayer(playerid, Coisa[playerid]);
return 1;
}
forward Killstreak();
public Killstreak()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid ++)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
new str[128];
new lvl2;
new lvl = (pDataInfo[playerid][Matou]+pDataInfo[playerid][Kills]-lvl2/5)/5;
if(lvl < 0)
{
lvl2=0;
}
else lvl2=lvl;
format(str, sizeof(str), "~w~Info /score /vip : ~n~~g~Matou: ~w~%d ~n~~g~Morreu: ~w~%d ~n~~y~Respeito: ~w~%d ~n~~b~Score: ~w~%d" , pDataInfo[playerid][Matou]+ pDataInfo[playerid][Kills], pDataInfo[playerid][Morreu]+ pDataInfo[playerid][Deaths], pDataInfo[playerid][Matou]+ pDataInfo[playerid][Kills]-(5*lvl2), lvl2);
TextDrawSetString(Coisa[playerid], str);
}
}
}