My commands is kind bugged[SOLVED]
#1

Well uhm i've made repair command:

Код:
dcmd_repair(const playerid, const cmdtext[])
{
	#pragma unused cmdtext
	
	if(IsPlayerInAnyVehicle(playerid) == 1)
	if(Tanker[playerid] == 1)

		{

		if(repair[playerid] == 0)

			  {
					GameTextForPlayer(playerid,"~y~You are Repairing vehicle ~n~~n~wait 10 seconds!",10000, 3);
					TogglePlayerControllable(playerid, false);
					repair[playerid] = 1;
					
					SetTimer("Repair", 60000, 0);
					
					SetTimer("opoznienier", 10000, 0);
				}
				else
				{
				  SendClientMessage(playerid,0xE2C063FF, "You have to wait 1 minute before you can use this command again!");
				}
			}
	return 1;
}
And those are publics for the timers:

Код:
public opoznienier(playerid)
{
      TogglePlayerControllable(playerid, 1);
	  RepairVehicle(GetPlayerVehicleID(playerid));
	  GameTextForPlayer(playerid,"~y~ You repaired the vehicle!",1000, 1);

     return 1;
}
Код:
public Repair(playerid)
{
	repair[playerid] = 0;
 	return 0;
}
Now the problem is that this command works PERFECT for me! but if somebody else tries to use it, it dosent unfreeze him after 10seconds, and it sends:

Код:
GameTextForPlayer(playerid,"~y~ You repaired the vehicle!",1000, 1);
to me not to the player that is using this command at the moment. I tried many things to solve this
but it still dosent work. Please help!

Regards.
Reply
#2

I think its because You used SetTimer Instead of SetTimerEx

SetTimerEx of both would be:

pawn Код:
SetTimerEx("Repair",60000,0,"i",playerid);
SetTimerEx("opoznienier",10000,0,"i",playerid);
Reply
#3

Quote:
Originally Posted by Miokie*
I think its because You used SetTimer Instead of SetTimerEx

SetTimerEx of both would be:

pawn Код:
SetTimerEx("Repair",60000,0,"i",playerid);
SetTimerEx("opoznienier",10000,0,"i",playerid);
Haha it was that easy xD its working now thank you for Help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)