[Help] SetPlayerPos is not working -
Emanuel_Rodriguez - 30.07.2010
Ok so here it is, I am making it where if u enter a cop car and your not a police, you will teleport z+2.0, anyone?
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == 2)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 405)
{
GameTextForPlayer(playerid, "Civilian Vehicle", 3000, 3);
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_WHITE, "You can start your engine by typing: /start");
return 1;
}
else if(GetVehicleModel(vehicleid) == 596)
{
new Float:x, Float:y, Float:z = SetPlayerPos(playerid,x,y,z);
if(gTeam[playerid] != POLICE) return SendClientMessage(playerid, COLOR_RED, "You are not a cop!") || SetPlayerPos(playerid,x,y,z+2.0);
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_WHITE, "You can start your engine by typing: /start");
return 1;
}
return 1;
}
return 1;
}
Re: [Help] SetPlayerPos is not working -
LeNy - 30.07.2010
Код:
new Float:x, Float:y, Float:z;
SetPlayerPos(playerid,x,y,z);
Re: [Help] SetPlayerPos is not working -
Emanuel_Rodriguez - 30.07.2010
Quote:
Originally Posted by LeNy
Код:
new Float:x, Float:y, Float:z;
SetPlayerPos(playerid,x,y,z);
|
I already have that, its in the script...
Re: [Help] SetPlayerPos is not working -
Hijolion - 30.07.2010
You don't have the coordinate where they will be positioned. Do you mean next or top of the car ?
Re: [Help] SetPlayerPos is not working -
Mike Garber - 30.07.2010
Why are you doing this? :S
Use SetVehicleParamsForPlayer instead...
Re: [Help] SetPlayerPos is not working -
Joe_ - 30.07.2010
SetVehicleParamsForPlayer has it's downs, It has to be re-synced every time a vehicle is streamed in (Which would require a loop, checking if it's a cop vehicle or something, every time a vehicle comes into sight)
And you can't get in it as a passenger, it's best to keep it at OnPlayerStateChange.
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid), m = GetVehicleModel(vehicleid);
if(m == 405)
{
GameTextForPlayer(playerid, "Civilian Vehicle", 3000, 3);
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_WHITE, "You can start your engine by typing: /start");
}
else if(m == 596)
{
new Float:x, Float:y, Float:z;
if(gTeam[playerid] != POLICE)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You are not a cop!");
}
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_WHITE, "You can start your engine by typing: /start");
}
return 1;
}
return 1;
}
Re: [Help] SetPlayerPos is not working -
Steven82 - 30.07.2010
Just do this when they enter the car, "RemovePlayerFromVehicle" so much eaiser on you.