Need a script/code !
#1

Hello everyebody x)
It's just one question:

Can you make a code for you can't get out a car !
I don't know to make a code for that

Plz reply ^^
Reply
#2

TogglePlayerControllable(playerid, 1);
~edit: this also makes not movable
Reply
#3

I think "not getting out the car" will be a bit hard. But you could do something like this i guess...

pawn Код:
//Untested
new IsDriverOf[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
     if(newstate == PLAYER_STATE_DRIVER)
     {
          IsDriverOf[playerid] = GetPlayerVehicleID(playerid);
     }
     if(oldstate == PLAYER_STATE_DRIVER)
     {
          PutPlayerInVehicle(playerid, IsDriverOf[playerid], 0);
     }
     return 1;
}
Reply
#4

Quote:
Originally Posted by funky1234
Посмотреть сообщение
I think "not getting out the car" will be a bit hard. But you could do something like this i guess...

pawn Код:
//Untested
new IsDriverOf[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
     if(newstate == PLAYER_STATE_DRIVER)
     {
          IsDriverOf[playerid] = GetPlayerVehicleID(playerid);
     }
     if(oldstate == PLAYER_STATE_DRIVER)
     {
          PutPlayerInVehicle(playerid, IsDriverOf[playerid], 0);
     }
     return 1;
}
Didn't work
Reply
#5

Just one I could think quickly:
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 0;
}
Reply
#6

Quote:
Originally Posted by thimo
Посмотреть сообщение
TogglePlayerControllable(playerid, 1);
~edit: this also makes not movable
Pretty sure this would work, have you tryed it?
Reply
#7

Quote:
Originally Posted by thimo
Посмотреть сообщение
TogglePlayerControllable(playerid, 1);
~edit: this also makes not movable
If i do that:
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    TogglePlayerControllable(playerid, 0);
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	TogglePlayerControllable(playerid, 1);
	return 1;
}
I can go in my car but i can't drive xd
Reply
#8

TogglePlayerControllable(playerid, 0);
TogglePlayerControllable(playerid, 1);

OnPlayerExitVehicle??
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)