23.12.2013, 21:50
(
Последний раз редактировалось maxy153; 31.12.2013 в 15:25.
Причина: Removed
)
__________________________
for(int playerid = 0; playerid != MAX_PLAYERS; playerid++)
{
if(GetPlayerWantedLevel(playerid) > 0)
{
// code
}
}
new updatetimer[MAX_PLAYERS]; OnGameModeInit: ---- updatetimer[playerid] = SetTimerEx("update", 1000, true, "d", playerid); ---- forward update(playerid); public update(playerid) { for(int playerid = 0; playerid != MAX_PLAYERS; playerid++) { if(GetPlayerWantedLevel(playerid) >= 1) { new string[124]; format(string, sizeof(string), "~b~~h~Tickets~h~(%d/10): ~g~~h~$%d000~n~~r~/ticket to pay", GetPlayerWantedLevel(playerid), GetPlayerWantedLevel(playerid)); TextDrawSetString(Ticket, string); Ticket = TextDrawCreate(497.000000, 129.000000, " "); return 1; } } return 1; }
new updatetimer[MAX_PLAYERS]; OnGameModeInit: ---- updatetimer[playerid] = SetTimerEx("update", 1000, true, "d", playerid); ---- forward update(playerid); public update(playerid) { for(new playerid = 0; playerid < MAX_PLAYERS; playerid++) { if(GetPlayerWantedLevel(playerid) >= 1) { new string[124]; format(string, sizeof(string), "~b~~h~Tickets~h~(%d/10): ~g~~h~$%d000~n~~r~/ticket to pay", GetPlayerWantedLevel(playerid), GetPlayerWantedLevel(playerid)); TextDrawSetString(Ticket, string); Ticket = TextDrawCreate(497.000000, 129.000000, " "); return 1; } } return 1; }
Код:
new updatetimer[MAX_PLAYERS]; OnGameModeInit: ---- updatetimer[playerid] = SetTimerEx("update", 1000, true, "d", playerid); ---- forward update(playerid); public update(playerid) { for(new playerid = 0; playerid < MAX_PLAYERS; playerid++) { if(GetPlayerWantedLevel(playerid) >= 1) { new string[124]; format(string, sizeof(string), "~b~~h~Tickets~h~(%d/10): ~g~~h~$%d000~n~~r~/ticket to pay", GetPlayerWantedLevel(playerid), GetPlayerWantedLevel(playerid)); TextDrawSetString(Ticket, string); Ticket = TextDrawCreate(497.000000, 129.000000, " "); return 1; } } return 1; } |
forward UpdateWanted();
public UpdateWanted()
{
for(new i, z = GetMaxPlayers(); i < z; i++)
{
if(!IsPlayerConnected(i) || GetPlayerWantedLevel(playerid) == 0)
continue;
new string[128];
format(string, sizeof string, "~b~~h~Tickets~h~(%d/10): ~g~~h~$%d000~n~~r~/ticket to pay", GetPlayerWantedLevel(playerid), GetPlayerWantedLevel(playerid));
return TextDrawSetString(Ticket, string);
}
}