Quick Question
#1

I'm drawing a blank.. if I am trying to make it so someone can do /goto if their if(PlayerInfo[playerid][pHelper] >= 1) OR if their if(PlayerInfo[playerid][pAdmin] >= 1) how would I do that? I just need to know how to make it so you can do it if your a helper level 1 OR an admin level 1. Thanks in advance.
Reply
#2

pawn Код:
if(PlayerInfo[playerid][pHelper] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
{
   // do something
}
This will do a check like, if the player typing the command is level 1 or bigger, do something.
If you wanted a specific level, change it to this:

pawn Код:
if(PlayerInfo[playerid][pHelper] == 1 || PlayerInfo[playerid][pAdmin] == 1)
{
   // do something
}
Notice the >= is now ==.
Reply
#3

Quote:
Originally Posted by Ljai
pawn Код:
if(PlayerInfo[playerid][pHelper] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
{
   // do something
}
put that under the command like so
Код:
if(!strcmp(cmdtext,"/goto,true,5))
{
 if(PlayerInfo[playerid][pHelper] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
 {
   // do something
 }
  return 1;
}
Reply
#4

Код:
public HBroadCast(color,const string[],level)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if (PlayerInfo[i][pHelper] >= 1 )
			{
  				if(OnHelperDuty[playerid]==0)
        {
				SendClientMessage(i, color, string);
				printf("%s", string);
			}
		}
	}
	}
	return 1;
}
And the error (On the HBroadCast line)

Код:
C:\Users\Tyler\Desktop\SARP\gamemode\gf.pwn(998) : error 025: function heading differs from prototype
C:\Users\Tyler\Desktop\SARP\gamemode\gf.pwn(998) : error 025: function heading differs from prototype
Reply
#5

I fixed the above, but I have a new problem..

Код:
public HBroadCast(color,const string[],level)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if (PlayerInfo[i][pHelper] >= 1 )
        {
        	if(OnHelperDuty[playerid]==1)
        	{
				SendClientMessage(i, color, string);
				printf("%s", string);
				}
			}
		}
	}
	return 1;
}
And it says "Unidentified "playerid" "
Reply
#6

Try Adding playerid To This Line

public HBroadCast(color,const string[],level)

If This Helps
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)