так просто не получится... надо к игроку приклеить каторый в машине! попробуй так:
#include <a_samp>
new att[MAX_PLAYERS];
stock AttachPlayerToVehicle(playerid)
{
att[playerid] = SetTimer("APTO",100,1);
return 1;
}
stock DeAttachPlayerToVehicle(playerid)
{
KillTimer(att[playerid]);
return 1;
}
forward APTO(playerid, id);
public APTO(playerid, id)
{
new Float:x,Float:y,Float:z;
new VehicleID = GetPlayerVehicleID(playerid);
GetVehiclePos(VehicleID,x,y,z);
SetPlayerPos(playerid,x,y,z+3);
new Float:wx,Float:wy,Float:wz;
new Float:cx,Float:cy,Float:cz;
GetPlayerPos(playerid,wx,wy,wz);
for(new j = 0; j < MAX_VEHICLES; j++) {
if(GetVehicleModel(j)) {
GetVehiclePos(j,cx,cy,cz);
if(IsPlayerInAnyVehicle(id)) {
if( floatsqroot( floatpower(wx-cx,2.0) + floatpower(wy-cy,2.0) + floatpower(wz-cz,4.0)) < 3.0) {
RemovePlayerFromVehicle(id);
PutPlayerInVehicle(playerid, j, 0);}}}}return 1;}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/attach", cmdtext, true) == 0)
{
AttachPlayerToVehicle(playerid);
return 1;
}
if (strcmp("/deattach", cmdtext,true) == 0)
{
DeAttachPlayerToVehicle(playerid);
return 1;
}
return 0;
}