HOW TO NAME OPEN GATE, NOT ORGANIZATION!?
#1

Hi, i want to make gate at house that just owner i set can open it.

For example, when pd organization can open gate on his garage i have this line in cmd

Код:
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
but when i want that only for example John_McGrory can open gate, what i need to change in this line?or it i need change something what is not in this line can you tell me?
tnx alot
Reply
#2

you would need to get the players name

if player name == so and so

then you can do a command and open/close
Reply
#3

so this

Код:
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
need to change into this

Код:
if(PlayerName[playerid] == John_McGrory)?
Reply
#4

something like that, since i cant see your whole coding thats about all i can offer
Reply
#5

ok, this is my code for open pd gate

Код:
if (strcmp(cmdtext, "/pdo", true)==0)
	{
		if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
		{
  		MoveObject(pdkapija,1587.672,-1638.206,19.376, 8.0);
			SendClientMessage(playerid, COLOR_GREEN, "OTVORILI STE KAPIJU.");
		}
		else return SendClientMessage(playerid, COLOR_GREEN, "NISTE POLICAJAC.");
	}
	if (strcmp(cmdtext, "/pdc", true)==0)
	{
		if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
		{
  		      MoveObject(pdkapija,1587.842,-1638.253,15.155, 8.0);
			SendClientMessage(playerid, COLOR_GREEN, "ZATVORILI STE KAPIJU");
		}
		else return SendClientMessage(playerid, COLOR_GREEN, "NISTE POLICAJAC.");
	}
so, what to change that just one name can open gate?
Reply
#6

i "think" not 100% positive

Код:
if (strcmp(cmdtext, "/pdo", true)==0)
	{
		if(GetPlayerName(playerid) == "name")
		{
  		MoveObject(pdkapija,1587.672,-1638.206,19.376, 8.0);
			SendClientMessage(playerid, COLOR_GREEN, "OTVORILI STE KAPIJU.");
		}
		else return SendClientMessage(playerid, COLOR_GREEN, "NISTE POLICAJAC.");
	}
	if (strcmp(cmdtext, "/pdc", true)==0)
	{
		if(GetPlayerName(playerid) == "name")
		{
  		      MoveObject(pdkapija,1587.842,-1638.253,15.155, 8.0);
			SendClientMessage(playerid, COLOR_GREEN, "ZATVORILI STE KAPIJU");
		}
		else return SendClientMessage(playerid, COLOR_GREEN, "NISTE POLICAJAC.");
	}
Reply
#7

i bet u helped another gf :{
Reply
#8

lol i wouldnt dought it but heck its what i do :P
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)