Getplayervehicle :S
#1

well i wanted to make a thing so if the player is in Team_Green it will be allowed to enter the car but if not then they kicked out of the car. But i did new GreenCar;

then GreenCar = Addstaticvehicke(bla bla bla );

then OnPlayerEnterVehicle
how do i get that things id i.e
if(Getvehicleid = greencar ) && if(gTeam[playerid] == Team_Green)

and suff please help

Reply
#2

heeeeeeeeeeeeeeeeeelllllllpppppppppp
Reply
#3

Quote:
Originally Posted by Criss_Angel
heeeeeeeeeeeeeeeeeelllllllpppppppppp
You waited 4 minutes. Don't expect help from anybody with patience like that.
Reply
#4

Quote:
Originally Posted by Weirdosport
Quote:
Originally Posted by Criss_Angel
heeeeeeeeeeeeeeeeeelllllllpppppppppp
You waited 4 minutes. Don't expect help from anybody with patience like that.
Well if your not going to help then just go away.

Does anyyone know anything about this :S
Reply
#5

Try using it on OnPlayerStateChange


maybe you could learn something out of a piece of my script;

Код:
	cabid= GetPlayerVehicleID(playerid);//
	if(cabid==LVtaxi || busid==LVbus )// make this just any vehicle later
	{
	if(newstate == PLAYER_STATE_PASSENGER)
 	SendClientMessage(playerid,0x80008096, "You just afraid to drive yourself dont you ?");
	for(new i = 0; i < MAX_PLAYERS; i++)
	SetPlayerMarkerForPlayer(i, playerid,0xFFFFFF00);
  GivePlayerMoney(playerid, -1);
  	}
Offcourse you will need PLAYER_STATE_DRIVER


have fun
Reply
#6

Quote:
Originally Posted by boelie
Try using it on OnPlayerStateChange


maybe you could learn something out of a piece of my script;

Код:
	cabid= GetPlayerVehicleID(playerid);//
	if(cabid==LVtaxi || busid==LVbus )// make this just any vehicle later
	{
	if(newstate == PLAYER_STATE_PASSENGER)
 	SendClientMessage(playerid,0x80008096, "You just afraid to drive yourself dont you ?");
	for(new i = 0; i < MAX_PLAYERS; i++)
	SetPlayerMarkerForPlayer(i, playerid,0xFFFFFF00);
  GivePlayerMoney(playerid, -1);
 	}
Offcourse you will need PLAYER_STATE_DRIVER


have fun
Sorry but i didn't understand a shit can you please just explain it better like in steps n stuff
Reply
#7

can't any1 else help
Reply
#8

try this
pawn Код:
cargreen= GetPlayerVehicleID(playerid);//
    if(cargreen==greencar && gTeam[playerid]!=TEAM_GREEN )// or your team
    {
    State=GetPlayerState(playerid);
    if(state == PLAYER_STATE_DRIVER)
    {
    new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                if(i != playerid)
                {
                    SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
                }
            }

    }
    SendClientMessage(playerid,COLOR_RED, "You Are Not in The Green team so, You cannot enter the car");
return 1;
}
Reply
#9

Still too many errors can anybody else help me please
Reply
#10

OMFG.

Код:
new GreenCar;

GreenCar = Addstaticvehicke(bla bla bla);

public OnPlayerStateChange(playerid, newstate, oldstate){
	if(newstate == PLAYER_STATE_DRIVER)
	{
		if(GetPlayerVehicleID(playerid) == GreenCar)
		{
			if(gTeam[playerid] != Team_Green)
			{
				for(new i=0; i<GetMaxPlayers(); i++) if(IsPlayerConnected(i) && i == playerid)
				{
					SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
				}
				RemovePlayerFromVehicle(playerid);
				SendClientMessage(playerid,COLOR_RED, "You Are Not in The Green team so, You cannot enter the car");
			}else{
				SendClientMessage(playerid,COLOR_RED, "Welcome Green team boy xD");
			}
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)