SA-MP Forums Archive
Minigun Event - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Minigun Event (/showthread.php?tid=610279)



Minigun Event - Loinal - 22.06.2016

i need if the minigun game started it show him that it started and in startmevent if any event is working it say to him that the event is already running

PHP код:
CMD:startmevent(playerid,params[])
{
if(
pInfo[playerid][pLevel] >= 7)
{
new 
string[134];
format(string,sizeof(string),"Admin %s Has Started The Minigun Event Type /joinm To Join The Event",GetName(playerid));
SendClientMessageToAll(yellow,string);
return 
1;
}
else return 
ShowMessage(playerid,red,1);
}
CMD:joinm(playerid,params[])
{
if(
InMinigun[playerid] == 1)
{
SendClientMessage(playerid,0xFF0000FF,"You Already In The Minigun Game");
}
if(
Started[playerid] == 1)
{
SendClientMessage(playerid,0xFF0000FF,"The Event Has Been Started Wait For The New Event");
}
else
{
SendClientMessage(playerid,yellow,"You Have Joined The Minigun Event");
InMinigun[playerid] = 1;
}
return 
1;




Re: Minigun Event - Matz - 22.06.2016

You will need to define something:

Код:
new bool:EvenInProgress;
Код:
CMD:startmevent(playerid,params[])
{
    if(EventInProgress == true) return SendClientMessage(playerid,0xFF0000FF,"The event is already in progress!");
	else if(pInfo[playerid][pLevel] >= 7)
	{
		new string[134];
		format(string,sizeof(string),"Admin %s Has Started The Minigun Event Type /joinm To Join The Event",GetName(playerid));
		SendClientMessageToAll(yellow,string);
		EventInProgress = true;
		return 1;
	}
	else return ShowMessage(playerid,red,1);
}