dcmd_noconducir( playerid, params[]) {
new jugadorid;
new str[124+MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "%s NO PUEDE CONDUCIR", name);
SendClientMessageToAll(-1, str);
if(sscanf(params, "u", jugadorid)) return SendClientMessage(playerid, -1, "Error: el uso correcto es /noconducir (id)");
noconducir[jugadorid] = true;
return true;
}
dcmd_noconducir( playerid, params[])
{
new jugadorid;
new str[68], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "%s NO PUEDE CONDUCIR", name);
SendClientMessageToAll(-1, str);
if(sscanf(params, "u", jugadorid)) return SendClientMessage(playerid, -1, "Error: el uso correcto es /noconducir (id)");
if(!IsPlayerConnected(jugadorid)) return SendClientMessage(playerid, -1, "Jugador no conectado");
RemovePlayerFromVehicle(jugadorid);
noconducir[jugadorid] = true;
return true;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) //entra a los vehiculos
{
if(!ispassenger)
{
if(noconducir[jugadorid] == true)
{
RemovePlayerFromVehicle(playerid);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
}
}
return true;
}
|
Funciуn que buscas: https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle
|

if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
if(noconducir[playerid] == true)
{
RemovePlayerFromVehicle(playerid);
}
}
RemovePlayerFromVehicleEx(playerid)
{
if(!IsPlayerInAnyVehicle(playerid))
return 0;
new Float:X, Float:Y, Float:Z;
RemovePlayerFromVehicle(playerid);
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z+2);
return 1;
}
|
Ya tengo esa funciуn en OnPlayerStateChange
![]() pawn Код:
|
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
dcmd_noconducir( playerid, params[])
{
new jugadorid;
new str[68], name[MAX_PLAYER_NAME],Float:x, Float:y, Float:z;
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "%s NO PUEDE CONDUCIR", name);
SendClientMessageToAll(-1, str);
if(sscanf(params, "u", jugadorid)) return SendClientMessage(playerid, -1, "Error: el uso correcto es /noconducir (id)");
if(!IsPlayerConnected(jugadorid)) return SendClientMessage(playerid, -1, "Jugador no conectado");
RemovePlayerFromVehicle(jugadorid);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z+3);
noconducir[jugadorid] = true;
return true;
}