04.03.2019, 04:10
Rapaz, eu estou longe de pawn, mas acredito que isto possa ajudar vocк. Abaixo estб uma base.
Lembrando: Nгo testei nada.
Tente isso como base:
Ou isso:
Lembrando: Nгo testei nada.
Tente isso como base:
PHP код:
new
bool:playerVehicle[MAX_PLAYERS char],
vehicleID_[MAX_PLAYERS]
;
COMMAND:vh(playerid, params[])
{
new vehicleID;
if(!sscanf(params, "d", vehicleID))
{
playerVehicle{playerid} ^= true;
DestroyVehicle(vehicleID_[playerid]);
new Float:playerPos[4];
GetPlayerPos(playerid, playerPos[0], playerPos[1], playerPos[2]);
GetPlayerFacingAngle(playerid, playerPos[3]);
vehicleID_[playerid] = CreateVehicle(vehicleID, playerPos[0], playerPos[1], playerPos[2] + 1.00, playerPos[3], 0, 1, 60);
PutPlayerInVehicle(playerid, vehicleID_[playerid], 0);
}
else
return SendClientMessage(playerid, -1, "[ERRO]: Parвmetros incorretos.");
return true;
}
PHP код:
COMMAND:vh(playerid, params[])
{
new vehicleID;
if(!sscanf(params, "d", vehicleID))
{
if(playerVehicle{playerid})
{
DestroyVehicle(vehicleID_[playerid]);
playerVehicle{playerid} = false;
}
new Float:playerPos[4];
GetPlayerPos(playerid, playerPos[0], playerPos[1], playerPos[2]);
GetPlayerFacingAngle(playerid, playerPos[3]);
vehicleID_[playerid] = CreateVehicle(vehicleID, playerPos[0], playerPos[1], playerPos[2] + 1.00, playerPos[3], 0, 1, 60);
PutPlayerInVehicle(playerid, vehicleID_[playerid], 0);
playerVehicle{playerid} = true;
}
else
return SendClientMessage(playerid, -1, "[ERRO]: Parвmetros incorretos.");
return true;
}