Need help with /backup Script, Help is appreciated
#1

Hello there,
Recently i've got this /bk script, which works fine, but ill tell you the problems

- The red marker shows up for everyone
- Everyone See's "bla bla is requesting backup, please respond"
- /bk doesnt work

Код:
	if(strcmp(cmd,"/backup",true)==0 || strcmp(cmd,"/bk",true)==0)
	{
		if(IsPlayerConnected(playerid))
		{
			if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
	    {
				if (PlayerInfo[playerid][pRequestingBackup] != 1)
				{
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "ALL UNITS: %s is requesting backup, they have been marked on your cruisers GPS .", sendername);
					PlayerInfo[playerid][pRequestingBackup] = 1;
					for(new i = 0; i < MAX_PLAYERS; i++)
					{
						if(IsPlayerConnected(i))
						{
							if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
	    {
								SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
								SendClientMessage(i, TEAM_BLUE_COLOR, string);
							}
						}
					}
					SendClientMessage(playerid, TEAM_BLUE_COLOR, "Type /bkc to clear your backup request.");
					SetTimerEx("BackupClear", 200000, false, "ii", playerid, 1);
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, "You already have an active backup request!");
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "You are not a cop!");
			}
		}
		return 1;
	}
Also i'd like to also mention, will anyone be kind enough to script me a /goverment, or find me one?

Thanks
Reply
#2

bump
Reply
#3

bump
Reply
#4

Well, if the player needs to member or leader of BOTH factions, try this...

Код:
if(PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 2)
Really, its depending on the faction ID's, if you can please tell me the ID's of the factions and names of the factions that you want to see this marker,
it would help :P
Reply
#5

you are using playerid instead of i in your for loop, so the variables it is checking is based off of the person who typed the command.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)