SA-MP Forums Archive
Some qestions... - 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)
+--- Thread: Some qestions... (/showthread.php?tid=360038)



Some qestions... - jimis - 16.07.2012

1.Guys how i can send a message to a specific skin.For example when someone type /medic then a message will be send to all players who have medic skin(275) .

2.How can eject a player from a police car if he dont have police skin(282) and the same with ambulance(275)?


Re: Some qestions... - Ballu Miaa - 16.07.2012

1. You can SendClientMessage for the playerid who are in the team of Medic or add a check like this for the skin.
pawn Код:
for(new i=0;i<=MAX_PLAYERS;i++) // TEAM METHOD
{
    if(gTeam[i] == TEAM_MEDIC )
   {
        // ADD YOUR CODE OVER HERE
   }
}
pawn Код:
for(new i=0;i<=MAX_PLAYERS;i++) // SKIN METHOD
{
    if(GetPlayerSkin[i] == SKINIDYOUWANTTOCHECK)
    {
          SendClientMessage(i,COLOR_WHITE,"Your Checked!");
    }
}
2. Use this under OnPlayerUpdate
pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 275 || (GetVehicleModel(GetPlayerVehicleID(playerid)) == ENTERPOLICECARID)
    {
          if(GetPlayerSkin(playerid) != ENTERSKINIDYOUWANT) return RemovePlayerFromVehicle(playerid);
    }
}



Re: Some qestions... - jimis - 16.07.2012

ok thanks +1


Re: Some qestions... - Captain_Mani - 16.07.2012

Ahh I was too testing a code for you for the first one.. :\

Код:
if (GetPlayerSkin(playerid == 275))
	{
	SendClientMessage(playerid, COLOR_RED, "You are medic! :D");
 	}
	return 1;