stock Stats(playerid)
{
new string[128],text[128];
//posao
if(GetPVarInt(playerid, "Posao") == 1) { text = "Detektiv"; }
else if(GetPVarInt(playerid, "Posao") == 2) { text = "Advokat"; }
else if(GetPVarInt(playerid, "Posao") == 3) { text = "Prostitutka"; }
else if(GetPVarInt(playerid, "Posao") == 4) { text = "Diler Droge"; }
else if(GetPVarInt(playerid, "Posao") == 5) { text = "Kradljivac Auta"; }
else if(GetPVarInt(playerid, "Posao") == 7) { text = "Automehanicar"; }
else if(GetPVarInt(playerid, "Posao") == 8) { text = "Bodyguard"; }
else if(GetPVarInt(playerid, "Posao") == 9) { text = "Diler Oruzja"; }
else if(GetPVarInt(playerid, "Posao") == 10) { text = "Farmer"; }
else if(GetPVarInt(playerid, "Posao") == 12) { text = "Bokser"; }
else if(GetPVarInt(playerid, "Posao") == 14) { text = "Vozac Autobusa"; }
else if(GetPVarInt(playerid, "Posao") == 15) { text = "Raznosac Novina"; }
else if(GetPVarInt(playerid, "Posao") == 16) { text = "Kamiondzija"; }
else if(GetPVarInt(playerid, "Posao") == 17) { text = "Raznosac Pice"; }
else if(GetPVarInt(playerid, "Posao") == 18) { text = "Uzgajivac Droge"; }
else if(GetPVarInt(playerid, "Posao") == 19) { text = "Uzgajivac Droge"; }
else if(GetPVarInt(playerid, "Posao") == 20) { text = "Svercer Droge"; }
else if(GetPVarInt(playerid, "Posao") == 21) { text = "Cistac Ulica"; }
else if(GetPVarInt(playerid, "Posao") == 22) { text = "Svercer Matsa"; }
else if(GetPVarInt(playerid, "Posao") == 13) { text = "Proizvodac oruzija"; }
else { text = "Nezaposlen"; } // ako je id posla 0 odnosno ako je igrac nezaposlen
//
format(string,sizeof(string),"Ime i prezime : %s~n~~n~Novac: %d$~n~~n~Posao: %s",GetName(playerid),GetPlayerMoney(playerid),text);
TextDrawSetString(StatsTDLevo[playerid], string); //
ShowStatsDusan(playerid);//ovo ću objasniti u idućem koraku (korak 4 )
return 1;
}
if (strcmp(cmd, "/stats", true) == 0)
{
if(GetPlayerState(playerid) != 2)
{
if(Pokrenuti[playerid] == 0)
{
Stats(playerid);
Pokrenuti[playerid] = 1;
}else{SCM(playerid, -1, " Nemozete gledati statse tijekom voћnje !");}
}
return 1;
}
if (strcmp(cmd, "/stats", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (Pokrenuti[playerid] != 0)
{
Stats(playerid, playerid);
Pokrenuti[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not Logged in !");
}
}
return 1;
}
|
pawn Код:
|
|
ShowStatsDusan - I guess this function shows the stats textdraw 'StatsTDLevo', so can you show us how it's done?
|
StatsTDLevo[playerid] = TextDrawCreate(148.000000, 142.000000, "Racun");
TextDrawBackgroundColor(StatsTDLevo[playerid], 255);
TextDrawFont(StatsTDLevo[playerid], 1);
TextDrawLetterSize(StatsTDLevo[playerid], 0.500000, 1.000000);
TextDrawColor(StatsTDLevo[playerid], 12582911);
TextDrawSetOutline(StatsTDLevo[playerid], 0);
TextDrawSetProportional(StatsTDLevo[playerid], 1);
TextDrawSetShadow(StatsTDLevo[playerid], 1);
// This code creates a textdraw for each player (Depends on the defination of MAX_PLAYERS).
// It's preferred to put this code either under OnGameModeInit or OnFilterScriptInit
for(new i = 0; i < MAX_PLAYERS; i ++)
{
StatsTDLevo[i] = TextDrawCreate(148.000000, 142.000000, "Racun");
TextDrawBackgroundColor(StatsTDLevo[i], 255);
TextDrawFont(StatsTDLevo[i], 1);
TextDrawLetterSize(StatsTDLevo[i], 0.500000, 1.000000);
TextDrawColor(StatsTDLevo[i], 12582911);
TextDrawSetOutline(StatsTDLevo[i], 0);
TextDrawSetProportional(StatsTDLevo[i], 1);
TextDrawSetShadow(StatsTDLevo[i], 1);
}
stock ShowStatsDusan(playerid)
{
TextDrawShowForPlayer(playerid, StatsTDLevo[playerid]);
return 1;
}
TextDrawHideForPlayer(playerid, StatsTDLevo[playerid]);