Cop Command
#1

I'm converting police gate commands from one filterscript to the gamemode script.. This is what i done

Код:
	if (strcmp(cmdtext, "/1close", true) == 0)
	{
	if(IsPlayerConnected(playerid))
	{
	if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
	{
	MoveObject(gates[4], 246.750320,72.625373,1003.791320,1);
	}
	else
	{
	SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Your not a cop.");
	}
	}
	return 1;
	}
But even when i am a cop it says "Your not a cop" does anyone know where i went wrong?
Reply
#2

Did you copy al misc defines etc and function from the fs to the gm. You dont have any warnings?

try this, i dont know if it works but you can try:
if(PlayerInfo[playerid] [pFaction] == 225)
{
if(DynamicFactions[PlayerInfo[playerid] [pFaction]] [fType] == 1)
{
// here you moveobject code
}
}

instead of this line:
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
Reply
#3

The defines etc were already in the gm, the reason im moving it from FS to GM is so only cops can open the gates, the FS's defines are only the colors for messages
Reply
#4

I'm sure the cop faction is normally id 0.
Reply
#5

I've tried this
Код:
	if (strcmp(cmdtext, "/pd1cl", true) == 0)
	{
	if(PlayerInfo[playerid] [pFaction] == 225)
	{
   if(DynamicFactions[PlayerInfo[playerid] [pFaction]] [fType] == 1)
   {
			MoveObject(Closed, 248.618835,72.400421,998.140930,5);
	}
	}
	return 1;
}
But no luck..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)