SetTimerEx
#1

PHP код:
forward gggg(color[8], t);
public 
gggg(color[8], t)
{
    if(
== 0)return 1;
    new 
str[256];
    
format(strsizeof(str), "%d, %d"color[0], color[2]);
    
SendClientMessageToAll(0x00FF00FFstr);
    
SetTimerEx("gggg"10000"sd"colort-1);
    return 
1;

why does the SetTimerEx crash my server?
Reply
#2

Wtf is that code tbh?!?!
Check https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#3

Quote:
Originally Posted by RowdyrideR
Посмотреть сообщение
Wtf is that code tbh?!?!
Check https://sampwiki.blast.hk/wiki/SetTimerEx
This code is example of this code:
PHP код:
forward ChangeGangZoneC(gangzonecolor[8], time1time2time3type);
public 
ChangeGangZoneC(gangzonecolor[8], time1time2time3type)
{
    new 
color1color2;
    for(new 
i4i++)color1 += GangZoneInfo[gangzone][GangZoneColor][i]*(floatround(floatpower(2563-i)));
    for(new 
i4i++)color2 += GangZoneInfo[gangzone][GangZoneColor][i+4]*(floatround(floatpower(2563-i)));
    if(
type == -1)
    {
        
GangZoneHideForAll(GangZoneInfo[gangzone][GangZoneId]);
        
GangZoneShowForAll(GangZoneInfo[gangzone][GangZoneId], color1);
        return 
1;
    }
    if(
time3 == 0)time3 GetTickCount();
    if((
GetTickCount()-time3 time1 || color1 == color2) && type == 1)
    {
        return 
1;
    }
    for(new 
i4i++)GangZoneInfo[gangzone][GangZoneColor][i] = color[i+4]+(color[i]-color[i+4])*((GetTickCount()-time3)/time1);
    
color1 0;
    for(new 
i4i++)color1 += GangZoneInfo[gangzone][GangZoneColor][i]*(floatround(floatpower(2563-i)));
    
GangZoneHideForAll(GangZoneInfo[gangzone][GangZoneId]);
    
GangZoneShowForAll(GangZoneInfo[gangzone][GangZoneId], color1);
    
SendClientMessageToAll(0x00FF00FF"GGG");
    
SetTimerEx("ChangeGangZoneC"time20"dsdddd"gangzonecolortime1time2time3type);
    return 
1;

I put the full code in my server
and the SetTimerEx crash my server
Reply
#4

Quote:
Originally Posted by idan123
Посмотреть сообщение
This code is example of this code:
PHP код:
forward ChangeGangZoneC(gangzonecolor[8], time1time2time3type);
public 
ChangeGangZoneC(gangzonecolor[8], time1time2time3type)
{
    new 
color1color2;
    for(new 
i4i++)color1 += GangZoneInfo[gangzone][GangZoneColor][i]*(floatround(floatpower(2563-i)));
    for(new 
i4i++)color2 += GangZoneInfo[gangzone][GangZoneColor][i+4]*(floatround(floatpower(2563-i)));
    if(
type == -1)
    {
        
GangZoneHideForAll(GangZoneInfo[gangzone][GangZoneId]);
        
GangZoneShowForAll(GangZoneInfo[gangzone][GangZoneId], color1);
        return 
1;
    }
    if(
time3 == 0)time3 GetTickCount();
    if((
GetTickCount()-time3 time1 || color1 == color2) && type == 1)
    {
        return 
1;
    }
    for(new 
i4i++)GangZoneInfo[gangzone][GangZoneColor][i] = color[i+4]+(color[i]-color[i+4])*((GetTickCount()-time3)/time1);
    
color1 0;
    for(new 
i4i++)color1 += GangZoneInfo[gangzone][GangZoneColor][i]*(floatround(floatpower(2563-i)));
    
GangZoneHideForAll(GangZoneInfo[gangzone][GangZoneId]);
    
GangZoneShowForAll(GangZoneInfo[gangzone][GangZoneId], color1);
    
SendClientMessageToAll(0x00FF00FF"GGG");
    
SetTimerEx("ChangeGangZoneC"time20"dsdddd"gangzonecolortime1time2time3type);
    return 
1;

I put the full code in my server
and the SetTimerEx crash my server
Thanks very much
I succeeded to solve the problem I do this:

PHP код:
forward ChangeGangZoneC(gangzonecolor[8], time1time2time3type);
public 
ChangeGangZoneC(gangzonecolor[8], time1time2time3type)
{
    new 
color1color2;
    for(new 
i4i++)color1 += GangZoneInfo[gangzone][GangZoneColor][i]*(floatround(floatpower(2563-i)));
    for(new 
i4i++)color2 += GangZoneInfo[gangzone][GangZoneColor][i+4]*(floatround(floatpower(2563-i)));
    if(
type == -1)
    {
        
GangZoneHideForAll(GangZoneInfo[gangzone][GangZoneId]);
        
GangZoneShowForAll(GangZoneInfo[gangzone][GangZoneId], color1);
        return 
1;
    }
    if(
time3 == 0)time3 GetTickCount();
    if((
GetTickCount()-time3 time1 || color1 == color2) && type == 1)
    {
        return 
1;
    }
    for(new 
i4i++)GangZoneInfo[gangzone][GangZoneColor][i] = color[i+4]+(color[i]-color[i+4])*((GetTickCount()-time3)/time1);
    
color1 0;
    for(new 
i4i++)color1 += GangZoneInfo[gangzone][GangZoneColor][i]*(floatround(floatpower(2563-i)));
    
GangZoneHideForAll(GangZoneInfo[gangzone][GangZoneId]);
    
GangZoneShowForAll(GangZoneInfo[gangzone][GangZoneId], color1);
    
SendClientMessageToAll(0x00FF00FF"GGG");
    
SetTimerEx("ChangeGangZoneC"time20"dddddd"gangzonecolortime1time2time3type);
    return 
1;

(look on the SetTimerEx)
Reply
#5

Quote:
Originally Posted by idan123
Посмотреть сообщение
Thanks very much
I succeeded to solve the problem I do this:

PHP код:
forward ChangeGangZoneC(gangzonecolor[8], time1time2time3type);
public 
ChangeGangZoneC(gangzonecolor[8], time1time2time3type)
{
    new 
color1color2;
    for(new 
i4i++)color1 += GangZoneInfo[gangzone][GangZoneColor][i]*(floatround(floatpower(2563-i)));
    for(new 
i4i++)color2 += GangZoneInfo[gangzone][GangZoneColor][i+4]*(floatround(floatpower(2563-i)));
    if(
type == -1)
    {
        
GangZoneHideForAll(GangZoneInfo[gangzone][GangZoneId]);
        
GangZoneShowForAll(GangZoneInfo[gangzone][GangZoneId], color1);
        return 
1;
    }
    if(
time3 == 0)time3 GetTickCount();
    if((
GetTickCount()-time3 time1 || color1 == color2) && type == 1)
    {
        return 
1;
    }
    for(new 
i4i++)GangZoneInfo[gangzone][GangZoneColor][i] = color[i+4]+(color[i]-color[i+4])*((GetTickCount()-time3)/time1);
    
color1 0;
    for(new 
i4i++)color1 += GangZoneInfo[gangzone][GangZoneColor][i]*(floatround(floatpower(2563-i)));
    
GangZoneHideForAll(GangZoneInfo[gangzone][GangZoneId]);
    
GangZoneShowForAll(GangZoneInfo[gangzone][GangZoneId], color1);
    
SendClientMessageToAll(0x00FF00FF"GGG");
    
SetTimerEx("ChangeGangZoneC"time20"dddddd"gangzonecolortime1time2time3type);
    return 
1;

(look on the SetTimerEx)
i check it agin and it's don't work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)