Help needed guys plz urgent plz help !!
#1

GUys i have a cmd called gwar but i want that in gwar player should not use god mode so how i make use it plz help guys

Код:
CMD:god(playerid)
{
	if(pLogged[playerid] == false)
		return Error(playerid, "You must be logged in in order to enable godmode!");

	if(doingStunt[playerid] == 33 || doingStunt[playerid] == 18 || doingStunt[playerid] == 19)
		return Error(playerid, "You can't use godmode in the minigame!");

	if(InDM[playerid] != 0)
	return Error(playerid, "You can't use godmode in DM zones!");
 	if(InEvent[playerid] != 0)
	return Error(playerid, "You can't use godmode in an event!");
	if(bounty[playerid] > 0)
	return Error(playerid, "You currently have a hit on you, you can't enable godmode!");

	if(GOD[playerid] == 0)
	{
     	new Float:hp;
	    GetPlayerHealth(playerid, hp);

	 	if(PlayerHit[playerid] == true)
			return Error(playerid, "You can't enable godmode while being shot at!");

	    SendClientMessage(playerid, COLOR_GREEN, ""USF" "GREY_E"You have enabled god-mode. You will now have infinite health in stunt zones.");
  		SendClientMessage(playerid, COLOR_RED, "> "YELLOW_E"You will not be able to use weapons with godmode enabled, type /god again to disable.");
  		ResetPlayerWeapons(playerid);
  	  	GOD[playerid] = 1;
  	  	TextDrawShowForPlayer(playerid, godTD);
	    InfoTD_MSG(playerid, 4000, "~y~~h~You have ~g~enabled ~y~~h~godmode!");
	    format(str, sizeof(str), "4Server:3 %s(%i)2 has enabled godmode.", pName[playerid], playerid);
		IRC_GroupSay(ircGroup, IRC_CHANNEL, str);
		if(god3D[playerid] == Text3D:-1) god3D[playerid] = CreateDynamic3DTextLabel("Godmode {41FF00}ON", 0xFFFF8288, 0, 0, 0.42, 16.0, playerid, INVALID_VEHICLE_ID, 1);
		if(pPremium[playerid] == 3) SetPlayerArmour(playerid, 100);
        if(killStreak[playerid] != 0) killStreak[playerid] = 0, Info(playerid, "Your killstreak has been reset to 0.");
	}
	else
 	{
 		InfoTD_MSG(playerid, 4000, "~y~~h~You have ~r~disabled ~y~~h~godmode!");
		SendClientMessage(playerid, COLOR_RED, ""USF" "GREY_E"You have disabled god-mode. You can now lose health in stunt zones.");
		SendClientMessage(playerid, COLOR_RED, "> "YELLOW_E"You can now freely use weapons.");
 		GOD[playerid] = 0;
 		SetPlayerHealth(playerid, 100);
 		TextDrawHideForPlayer(playerid, godTD);
 		if(doingStunt[playerid] == 0)
 		{
 			GiveSpawnWeapons(playerid);
   		}
	    format(str, sizeof(str), "4Server:3 %s(%i)2 has disabled godmode.", pName[playerid], playerid);
		IRC_GroupSay(ircGroup, IRC_CHANNEL, str);
  		DestroyDynamic3DTextLabel(god3D[playerid]);
		god3D[playerid] = Text3D:-1;
	}
	PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
	return true;
}
// this is In gamemode

Now its Gwar CMD its in filterscript

Код:
COMMAND:gwar(playerid, params[])
{
	if(Player[playerid][PlayerGang] != -1)
	{
		if(Gang[Player[playerid][PlayerGang]][CurrentZone] == -1)
		{
			new bool:found = false, i, total = 0, area = Area_GetPlayerAreas(playerid, 0);
			foreach(i : GangZones)
			{
				if(area == GangZone[i][ZoneArea])
				{
					found = true;
					break;
				}
			}
			if(found)
			{
				if(!GangZone[i][ZoneStatus])
				{
					if(GangZone[i][ZoneOwner] != Player[playerid][PlayerGang])
					{
						new tick = GetTickCount() - GangZone[i][ZoneLocked], msg[128];
						if(tick > (60000 * LOCKED_MINUTES))
						{
							format(msg, sizeof(msg), "Capturing ~g~%s", GangZone[i][ZoneName]);
							foreach(new p : Player)
							{
								if(Player[p][PlayerGang] == Player[playerid][PlayerGang])
								{
									if(god[playerid] != 0)return Error(playerid, "You can't use godmode in DM zones!");
									if(Area_GetPlayerAreas(p, 0) == area)
									total++;
									PlayerTextDrawSetString(p, Player[p][CaptureTD][0], msg);
									PlayerTextDrawSetString(p, Player[p][CaptureTD][1], "-");
									PlayerTextDrawShow(p, Player[p][CaptureTD][0]);
									PlayerTextDrawShow(p, Player[p][CaptureTD][1]);
									Gang[Player[playerid][PlayerGang]][GangTimer] = CAPTURE_TIME;
								}
							}
							format(msg, sizeof(msg), "{FE9A2E}** %s gang trying to capture %s zone with %d gang member!", Gang[Player[playerid][PlayerGang]][GangName], GangZone[i][ZoneName], total);
							SendClientMessageToAll(-1, msg);
						    SendPlayerMessageToPlayer(0, playerid, "{FE9A2E}Before Gwar Make Sure you have disabled the GOTO. Use ../toggoto before gwar");
							GangZone[i][ZoneStatus] = true;
							GangZone[i][ZoneTimer] = SetTimerEx("AttackZone", 1000, true, "dd", Player[playerid][PlayerGang], i);
							Gang[Player[playerid][PlayerGang]][CurrentZone] = i;
							GangZoneFlashForAll(GangZone[i][ZoneHolder], HexToInt("FF0000AA"));
							if(GangZone[i][ZoneOwner] != -1)
							{
								format(msg, sizeof(msg), "{FF0000}* ALERT!!! %s gang trying to capture your territory in %s", Gang[Player[playerid][PlayerGang]][GangName], GangZone[i][ZoneName]);
								SendGangMessage(GangZone[i][ZoneOwner], msg);
							}
						}
						else
						{
							format(msg, sizeof(msg), "{FF0000}This Zone is locked, please wait %.2f minute(s) to capture!", floatdiv(60000 * LOCKED_MINUTES - tick, 60 * 1000));
							SendClientMessage(playerid, -1, msg);
						}
					}
					else
						SendClientMessage(playerid, -1, "{FF0000}Your gang already owned this zone!");
				}
				else
					SendClientMessage(playerid, -1, "{FF0000}Someone is trying to capture this zone!");
			}
			else
				SendClientMessage(playerid, -1, "{FF0000}You must be in gang zone to use this command!");
		}
		else
			SendClientMessage(playerid, -1, "{FF0000}Your gang already started a war, please wait!");
	}
	else
		SendClientMessage(playerid, -1, "{FF0000}You must be a gang member to use this command!");
	return 1;
}
Plz code it and post here plz // tommorow is my server release plz help
Reply


Messages In This Thread
Help needed guys plz urgent plz help !! - by Stop - 07.11.2016, 07:28
Respuesta: Help needed guys plz urgent plz help !! - by ghost556 - 07.11.2016, 07:35
Re: Help needed guys plz urgent plz help !! - by Stop - 07.11.2016, 07:43
Respuesta: Help needed guys plz urgent plz help !! - by ghost556 - 07.11.2016, 07:49
Re: Help needed guys plz urgent plz help !! - by Logic_ - 07.11.2016, 07:55

Forum Jump:


Users browsing this thread: 1 Guest(s)