People can't play on foot only in car. - 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: People can't play on foot only in car. (
/showthread.php?tid=284164)
People can't play on foot only in car. -
A.R.E.S.97 - 18.09.2011
Is there a method to do that the player can stay only in a car, no onfoot.
I need it please.
P.S. I need a Script
Best Regards
A.R.E.S.97
Sorry for my English but i'm italian.
Re: People can't play on foot only in car. -
doreto - 18.09.2011
you mean whan player connecto to servar to be put in vehicle ?
Re: People can't play on foot only in car. -
A.R.E.S.97 - 18.09.2011
Quote:
Originally Posted by doreto
you mean whan player connecto to servar to be put in vehicle ?
|
No, after player spawned, he can stay only in a car no on foot.
Re: People can't play on foot only in car. -
|_ⒾⓇⓄN_ⒹⓄG_| - 18.09.2011
pawn Code:
public OnPlayerExitVehicle(playerid, vehicleid)
{
PutPlayerInVehicle(playerid, vehicleid, 0); //DRIVER
return 1;
}
should be something like that
(not tested)
Re: People can't play on foot only in car. -
doreto - 18.09.2011
PHP Code:
public OnPlayerExitVehicle(playerid, vehicleid)
{
PutPlayerInVehicle(playerid,vehicleid,seatid);
return 1;
}
EDIT:to late
Re: People can't play on foot only in car. -
Jeffry - 18.09.2011
I've tested the ones above, didn't work for me.
This works for me:
pawn Code:
new Vehicle[MAX_PLAYERS] = {-1,...};
public OnPlayerExitVehicle(playerid, vehicleid)
{
Vehicle[playerid] = vehicleid;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER)
{
PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
SendClientMessage(playerid, -1, "You can't leave vehicles as driver!");
}
return 1;
}
public OnPlayerConnect(playerid)
{
Vehicle[playerid] = -1; //Player has no vehicle yet.
return 1;
}
Jeffry