SA-MP Forums Archive
OnPlayerEnterVehicle if if if { } problems - 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: OnPlayerEnterVehicle if if if { } problems (/showthread.php?tid=88553)



OnPlayerEnterVehicle if if if { } problems - boelie - 27.07.2009

Hello,

Im trying to make this;

When you enter a pd car as a cop (copskin) a message show up
when you enter the pd car as a civillian another message shows up
But..if you enter the pd car as a civillian being a 'passenger' some 'other' 'different' message shows up XD

This is what i have i changed several times changing the {or } and putting codes in another order but still nothing happens
I need some help here please;
Код:
  if(GetVehicleModel(vehicleid) == 598) //LVPD
  {
  new copskin = GetPlayerSkin(playerid);
  	new currentState = GetPlayerState(playerid);
	if (currentState == PLAYER_STATE_DRIVER)
	{
  if( (copskin == 287) || (copskin == 163) || (copskin == 282) || (copskin == 255) || (copskin == 165))
  	
  {
  
  	SendClientMessageToSkin(282, 0x0000FF96, "lvpd cop hitting the road");
  }
  	else
	{
	
	SendClientMessage(playerid,0x80008096, "your the none cop driver");
  	//SendClientMessageToSkin(282, 0x0000FF96, "DISPATCH: Someone enters a lvpd vehicle!");
	}
}

 }
	return 1;
}



Re: OnPlayerEnterVehicle if if if { } problems - Andom - 27.07.2009

Replace with:
Код:
if(copskin == 287 || copskin == 163 || copskin == 282 || copskin == 255 || copskin == 165)
And how is ''SendClientMessageToSkin'' defined?


Re: OnPlayerEnterVehicle if if if { } problems - boelie - 27.07.2009

Hiermee
dat zit verder wel goed;

(with this;..but that should be okay)

Код:
public SendClientMessageToSkin(skin, color, string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerSkin(i) == skin)
{
SendClientMessage(i, color, string);
}
}
}



Re: OnPlayerEnterVehicle if if if { } problems - boelie - 29.07.2009

this topic is dead already