Help For(new
#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


Messages In This Thread
Help For(new - by lonako45 - 04.05.2012, 14:48
Re: Help For(new - by Vince - 04.05.2012, 15:14
Re: Help For(new - by lonako45 - 04.05.2012, 15:18
Re: Help For(new - by Accord - 04.05.2012, 15:22
Re: Help For(new - by lonako45 - 04.05.2012, 15:36
Re: Help For(new - by JaTochNietDan - 04.05.2012, 15:43

Forum Jump:


Users browsing this thread: 1 Guest(s)