Hi guys, can you please help me
is this code a infinite loop ?
and this
and this
please help ! please guys :/ ! i don't know which one to delete
Code:
forward UpdateTime();
public UpdateTime()
{
gettime(hour2, minute2);
format(timestr,32,"%02d:%02d",hour2,minute2);
TextDrawSetString(txtTimeDisp,timestr);
SetWorldTime(hour2);
new x=0;
while(x!=MAX_PLAYERS) {
if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) {
SetPlayerTime(x,hour2,minute2);
}
x++;
}
}
and this
Code:
switch(skin_id)
{
case 299: next_skin = 0, prev_skin = 298;
case 0: next_skin = 1, prev_skin = 299;
default:
{
next_skin = (skin_id + 1), prev_skin = (skin_id - 1);
if(!IsValidSkin(next_skin))
{
while(next_skin <= 299)
{
next_skin++;
if(IsValidSkin(next_skin) && next_skin != skin_id)
{
break;
}
}
}
if(!IsValidSkin(prev_skin))
{
while(prev_skin >= 0)
{
prev_skin++;
if(IsValidSkin(prev_skin) && prev_skin != skin_id)
{
break;
}
}
}
}
}
Code:
switch(lr)
{
case 128:
{
skin_id -= 1;
if(skin_id < 0)
{
skin_id = 299;
}
if(!IsValidSkin(skin_id))
{
for(new s = skin_id; s > 1; s--)
{
if(IsValidSkin(s))
{
skin_id = s;
break;
}
}
}
SetPlayerSkin(playerid, skin_id);
UpdateTextdraw(playerid);
return 1;
}
case -128:
{
skin_id += 1;
if(skin_id > 299)
{
skin_id = 0;
}
if(!IsValidSkin(skin_id))
{
for(new s = skin_id; s > 0; s++)
{
if(IsValidSkin(s))
{
skin_id = s;
break;
}
}
}
SetPlayerSkin(playerid, skin_id);
UpdateTextdraw(playerid);
return 1;
}
}