Próbáld meg ezzel hátha jó
#include <a_samp>
new bool:Used[MAX_VEHICLES];
new PVeh[MAX_PLAYERS] = INVALID_VEHICLE_ID;
public OnFilterScriptInit()
{
for(new p; p < GetMaxPlayers(); p++)
{
if(!IsPlayerConnected(p) || GetPlayerState(p) != PLAYER_STATE_DRIVER) { continue; }
PVeh[p] = GetPlayerVehicleID(p);
Used[PVeh[p]] = true;
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
PVeh[playerid] = GetPlayerVehicleID(playerid);
Used[PVeh[playerid]] = true;
}
else if(oldstate == PLAYER_STATE_DRIVER)
{
Used[PVeh[playerid]] = false;
PVeh[playerid] = INVALID_VEHICLE_ID;
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
if(PVeh[playerid] != INVALID_VEHICLE_ID)
{
Used[PVeh[playerid]] = false;
PVeh[playerid] = INVALID_VEHICLE_ID;
}
return 1;
}
public OnPlayerCommandText(playerid,cmdtext[])
{
if(IsPlayerAdmin(playerid) && !strcmp(cmdtext,\"/carresi\",true))
{
for(new v = 1; v < MAX_VEHICLES; v++)
{
if(!GetVehicleModel(v) || Used[v]) { continue; }
SetVehicleToRespawn(v);
}
SendClientMessageToAll(0xFF6600FF,\"Jármûvek respawnolva...\");
return 1;
}
return 0;
}