zcmd GetPlayerColor help - 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: zcmd GetPlayerColor help (
/showthread.php?tid=239060)
zcmd GetPlayerColor help -
ricardo178 - 12.03.2011
Hey guys, the follwing code should give a minigun to a player if he have the colour 0xD8C762FF... I am making this for my cop system... i will need this!
Id what fail here but it give me this error:
Код:
C:\Users\Ricardo\Desktop\copsystem.pwn(16) : error 036: empty statement
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf>
public OnFilterScriptInit()
{
  print("\n--------------------------------------");
  print(" Cop System by Ricardo_Manuel");
  print("--------------------------------------\n");
  return 1;
}
COMMAND:duty(playerid, params[])
{
  if(GetPlayerColor(playerid) == 0xD8C762FF);
  GivePlayerWeapon(playerid, 38, 10000);
  return 1;
}
COMMAND:mycolor(playerid, params[])
{
  SetPlayerColor(playerid, 0xD8C762FF);
  return 1;
}
THANKS!
Re: zcmd GetPlayerColor help -
xir - 12.03.2011
I think you're using the "if" statement wrong.
Are you only using police teams? If you planning on adding more team, I suggest you to use "gTeam"
Re: zcmd GetPlayerColor help -
Skylar Paul - 12.03.2011
pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf>
public OnFilterScriptInit()
{
  print("\n--------------------------------------");
  print(" Cop System by Ricardo_Manuel");
  print("--------------------------------------\n");
  return 1;
}
COMMAND:duty(playerid, params[])
{
  if(GetPlayerColor(playerid) == 0xD8C762FF)
    return GivePlayerWeapon(playerid, 38, 10000);
  return 1;
}
COMMAND:mycolor(playerid, params[])
{
  SetPlayerColor(playerid, 0xD8C762FF);
  return 1;
}
Re: zcmd GetPlayerColor help -
Haydz - 12.03.2011
nvm i fail
Re: zcmd GetPlayerColor help -
ricardo178 - 12.03.2011
Thanks man, but by the way, how can i create just 1 rank(cop) than i can do /setrank playerid 1(cop) ? I need to create teams? How?
If this is very hard just show me a code for the some think(only let if player is this color) but to use in other players..
For example, i am blue color, so i can stun someone... Or jail!
I don't know make zcmd to Other id's!
Thanks
Re: zcmd GetPlayerColor help -
Scrip - 12.03.2011
try this
pawn Код:
COMMAND:duty(playerid, params[])
{
  GetPlayerColor(playerid) == 0xD8C762FF);
  GivePlayerWeapon(playerid, 38, 10000);
  return 1;
}