I need this with more skins (CMD ONLY COPS CAN OPEN MOVEOBJECTS) DONT WORK
#1

my command (DONT WORK):
Код:
if(!strcmp(cmdtext,"/openall",true))
	{
  if(GetPlayerSkin(playerid) == 285)
	if(GetPlayerSkin(playerid) == 267)
	if(GetPlayerSkin(playerid) == 280)
	if(GetPlayerSkin(playerid) == 281)
	if(GetPlayerSkin(playerid) == 282)
	if(GetPlayerSkin(playerid) == 283)
	if(GetPlayerSkin(playerid) == 284)
	if(GetPlayerSkin(playerid) == 286)
	if(GetPlayerSkin(playerid) == 288)
  MoveObject(MassenZelle, 3612.190918, -1683.627075, 4.788385, 9);
  if(GetPlayerSkin(playerid) == 285)
	if(GetPlayerSkin(playerid) == 267)
	if(GetPlayerSkin(playerid) == 280)
	if(GetPlayerSkin(playerid) == 281)
	if(GetPlayerSkin(playerid) == 282)
	if(GetPlayerSkin(playerid) == 283)
	if(GetPlayerSkin(playerid) == 284)
	if(GetPlayerSkin(playerid) == 286)
	if(GetPlayerSkin(playerid) == 288)
  MoveObject(AlleZellen, 3624.138672, -1672.828125, 8.700000, 9);
	return 1;
	}
Reply
#2

You should reallylearn how to script
Theres plenty of tutorials here: http://wiki.sa-mp.com
Reply
#3

i can script but that no
Reply
#4

Quote:
Originally Posted by RobShakur
i can script but that no
Can you script or do you think you can script?
Because judging by that code you cant..
Reply
#5

oh my good
okay im beginner that was you heard from me ?
Reply
#6

There are more and better ways but here is an example;

Код:
		if (!strcmp("/healing",cmdtext,true))
	  {
   	new copskin = GetPlayerSkin(playerid);
  	if( (copskin == 287) || (copskin == 163) || (copskin == 282) || (copskin == 255) || (copskin == 165))
		{
		SendClientMessage(playerid, 0x0000FF96, "== You are a cop.");
		SetPlayerHealth(playerid, 100.0);
		SetPlayerArmour(playerid,100);
		
		}
		else
		{
		SendClientMessage(playerid, 0xFFFF00AA, "== You are not a cop!.");
	  }

	  }
Replace setplayerhealth and gviegplayerarmour with your moveobject stuff
Reply
#7

Quote:
Originally Posted by boelie
There are more and better ways but here is an example;

Код:
		if (!strcmp("/healing",cmdtext,true))
	  {
   	new copskin = GetPlayerSkin(playerid);
  	if( (copskin == 287) || (copskin == 163) || (copskin == 282) || (copskin == 255) || (copskin == 165))
		{
		SendClientMessage(playerid, 0x0000FF96, "== You are a cop.");
		SetPlayerHealth(playerid, 100.0);
		SetPlayerArmour(playerid,100);
		
		}
		else
		{
		SendClientMessage(playerid, 0xFFFF00AA, "== You are not a cop!.");
	  }

	  }
Replace setplayerhealth and gviegplayerarmour with your moveobject stuff
You dont need all the ( and ), Only some,
Reply
#8

Quote:

You dont need all the ( and ), Only some,

Now im curious how would you make thise (and,and,and) then ?
Reply
#9

pawn Код:
if(GetPlayerSkin == SKINID || GetPlayerSkin == SKINID || GetPlayerSkin == SKINID || GetPlayerSkin == SKINID)
There.
Reply
#10

use switch for the skins its much more efficient.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)