BlowGate
#1

hi all , i have a problem with the command /blowgate , when 1 player use this command , that player can't plant the bomb...if ID 0 is not near this player who want to plant... what i can do ? i have 2 publics and 1 command.

Код:
CMD:blowgate(playerid, params[])
{
	if(IsPlayerInRangeOfPoint(playerid, 5,1446.4800, 663.3500, 13.2300))
	{
	    SetTimer("BlowgateRange", 10000, false);
		GameTextForPlayer(playerid, "~r~please~n~~y~wait here", 10000, 3);
		SetPlayerChatBubble(playerid, "Planting...", red, 100.0, 10000);
		return 1;
	}
    else return SendClientMessage(playerid,red,"You are not near gate!");
}
Public Nr.1 :

Код:
public BlowgateRange(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid, 5,1446.4800, 663.3500, 13.2300))
	{
 		if(AccInfo[playerid][c4] > 0)
 		{
			if(GetGVarInt( "gates", 1) == 0)
			{
				GetPlayerPos(playerid, bx[playerid], by[playerid], bz[playerid]);
				detonate = CreatePickup(1252, 23, bx[playerid], by[playerid], bz[playerid]);
				SetTimer("Blowgate", 10000, false);
				GameTextForPlayer(playerid, "~r~bomb~n~~y~planted", 3000, 3);
				return 1;
			}
			else if(GetGVarInt( "gates", 1) == 1)
			{
				SendClientMessage(playerid, red, "Gate allready destroyed");
				return 1;
			}
		}
		else return SendClientMessage(playerid,red,"You don't have enought C4");
 	}
	else return SendClientMessage(playerid,red,"You are not near gate!");
	return 1;
}
Public Nr.2 :

Код:
public Blowgate(playerid)
{
    DestroyPickup(detonate);
	DestroyObject(pthug);
	if(C4Veh[playerid] == 0)
	{
		CreateExplosion(bx[playerid], by[playerid], bz[playerid], 7, 15) &&
		CreateExplosion(bx[playerid], by[playerid], bz[playerid], 7, 15) &&
		CreateExplosion(bx[playerid], by[playerid], bz[playerid], 7, 15);
		GameTextForPlayer(playerid, "~r~bomb~n~~y~exploded", 3000, 3);
	}
	AccInfo[playerid][c4] -= 1;
	Planted[playerid] = 0;
	SetGVarInt( "gates", 1, 1 );
}
if any1 don't understand what i say...pleasy say

PS: srry for my bad englesh
Reply
#2

pawn Код:
SetTimerEx("BlowgateRange", 10000, false, "d", playerid);
Reply
#3

You are using SetTimer instead of SetTimerEx.
If you want to use any parameters in your Timer callbacks, you have to use SetTimerEx.
https://sampwiki.blast.hk/wiki/SetTimerEx

Код:
SetTimerEx("Blowgate", 10000, false, "i", playerid);
Reply
#4

ty Shetch and newbie
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)