Help For(new
#1

OK
I do Command
PHP код:
 if(strcmp(tmp"Join"true) == || strcmp(tmp"j"true) == 0
        { 
        if(
activity == 0) return SendClientMessage(playerid,White,"айп фтймеъ оефтмъ"); 
        if(
ActivityTeleports == 0) return SendClientMessage(playerid,White,"дазшай свш аъ дщйвешйн мфтймеъ емлп аъд ма йлем мдцишу"); 
        if(
JoinTime2[playerid] == 1) return SendClientMessage(playerid,White,"лбш бйчщъ мдцишу мфтймеъ , злд гчд ебчщ щеб"); 
        
format(string1sizeof(string1),"обчщ мдцишу мфтймеъ %s[%d] дщзчп",GetName(playerid),playerid); 
        
SendAdminsMessage(0x8e0c9ff,string1); 
        
SendClientMessage(playerid,0x8e0c9ff,"бйчщъ мдцишу мфтймеъ , злд щдазшай йцшу аеък"); 
        
GameTextForPlayer(playerid,"~r~Activity ~b~ Join !~<~",20,1); 
        
JoinTime[playerid] = SetTimerEx("JoinTime1"600000"i"playerid); 
        for(new 
0i<MAX_PLAYERSi++) if(IsPlayerConnected(i)) JoinTime2[i] = 1
        return 
1
        } 
PHP код:
public JoinTime1(playerid

SendClientMessage(playerid,0x48c14ff,"аъд йлем мбчщ мдцишу мфтймеъ щеб"); 
JoinTime2[playerid] = 0
return 
1

If player do command /join this work
but if he is do the command again its write him : You need wait 5 second
and this is work too
bbut but but but but the timer work to all player
Example :
Player one : /a j || You join to the activity !!!!
Player two: /a j || You use the command , wait second and try again
Why ?
Reply
#2

Have you learned absolutely nothing from your previous topic? Also I can't read Russian and it appears as random stuff on my screen.
Reply
#3

Yes I learn and this is no Russian
Not to be taken this, this is text it means the player text
Reply
#4

Please translate your text to english or somthing for read the texts.
Reply
#5

PHP код:
if(activity == 0) return SendClientMessage(playerid,White,"No Activity !");  
        if(
ActivityTeleports == 0) return SendClientMessage(playerid,White,"The Teleports closed!");  
        if(
JoinTime2[playerid] == 1) return SendClientMessage(playerid,White,"You Need wait one Minute");  
        
format(string1sizeof(string1),"The Player %s%d want join to activity",GetName(playerid),playerid);  
        
SendAdminsMessage(0x8e0c9ff,string1);  
        
SendClientMessage(playerid,0x8e0c9ff,"You ask the admin to join !");  
        
GameTextForPlayer(playerid,"~r~Activity ~b~ Join !~<~",20,1);  
        
JoinTime[playerid] = SetTimerEx("JoinTime1"600000"i"playerid);  
        for(new 
0i<MAX_PLAYERSi++) if(IsPlayerConnected(i)) JoinTime2[i] = 1;  
        return 
1;  
        } 
PHP код:
public JoinTime1(playerid)  
{  
SendClientMessage(playerid,0x48c14ff,"You Can use again the command /a j !");  
JoinTime2[playerid] = 0;  
return 
1;  

Now help ?
Reply
#6

Quote:
Originally Posted by lonako45
Посмотреть сообщение
PHP код:
if(activity == 0) return SendClientMessage(playerid,White,"No Activity !");  
        if(
ActivityTeleports == 0) return SendClientMessage(playerid,White,"The Teleports closed!");  
        if(
JoinTime2[playerid] == 1) return SendClientMessage(playerid,White,"You Need wait one Minute");  
        
format(string1sizeof(string1),"The Player %s%d want join to activity",GetName(playerid),playerid);  
        
SendAdminsMessage(0x8e0c9ff,string1);  
        
SendClientMessage(playerid,0x8e0c9ff,"You ask the admin to join !");  
        
GameTextForPlayer(playerid,"~r~Activity ~b~ Join !~<~",20,1);  
        
JoinTime[playerid] = SetTimerEx("JoinTime1"600000"i"playerid);  
        for(new 
0i<MAX_PLAYERSi++) if(IsPlayerConnected(i)) JoinTime2[i] = 1;  
        return 
1;  
        } 
PHP код:
public JoinTime1(playerid)  
{  
SendClientMessage(playerid,0x48c14ff,"You Can use again the command /a j !");  
JoinTime2[playerid] = 0;  
return 
1;  

Now help ?
The problem is that you are setting the JoinTime2 value to 1 for everyone, instead of just the person who did the command.

Replace this:

pawn Код:
for(new i = 0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i)) JoinTime2[i] = 1;
With this:

pawn Код:
JoinTime2[playerid] = 1;
Then you will only be restricting that players ability to do the command.

Also I would suggest using a GetTickCount system for determining when the player can execute a command again instead of timers.

For example:

pawn Код:
JoinTime2[playerid] = GetTickCount();
Then when you want to limit the player from doing it before, 60 seconds for example:

pawn Код:
if((GetTickCount() - 60000) < JoinTime2[playerid]) // Player has not waited 60 seconds
Absolutely no need for timers then.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)