Cop Command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Cop Command (
/showthread.php?tid=119055)
Cop Command -
Ritchie999 - 06.01.2010
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?
Re: Cop Command -
Oxside - 06.01.2010
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)
Re: Cop Command -
Ritchie999 - 06.01.2010
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
Re: Cop Command -
jameskmonger - 06.01.2010
I'm sure the cop faction is normally id 0.
Re: Cop Command -
Ritchie999 - 06.01.2010
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..