car respawn command doesn't working? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: car respawn command doesn't working? (
/showthread.php?tid=635367)
car respawn command doesn't working? -
DemME - 06.06.2017
PHP Code:
COMMAND:rac(playerid, params[])
{
new string[128], sendername[MAX_PLAYER_NAME];
if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You must be logged in to use this.");
if(GetPVarInt(playerid, "Admin") >= 3)
{
for(new v = 1; v <= MAX_VEHICLES; v++)
{
new bool:despawn = true;
foreach(new i : Player)
{
if(IsPlayerInAnyVehicle(i) && GetPlayerVehicleID(i) == v)
{
despawn = false;
}
}
if(despawn == true)
{
DespawnVehicle(v);
}
}
format(sendername, sizeof(sendername), "%s", PlayerInfo[playerid][pUsername]);
GiveNameSpace(sendername);
format(string, sizeof(string), "All unused cars despawned by %s.", sendername);
SendClientMessage(playerid,COLOR_WHITE,string);
}
else SendClientMessage(playerid, COLOR_ERROR, "You do not have access to this command!");
return 1;
Well it does despawn, but actually doesn't even announce to people and shows "wrong command" as I did already and tried to fix it out but.. eh? can anyone help me out please?
Re: car respawn command doesn't working? -
NewFreeroamStunt - 06.06.2017
SetVehicleToRespawn(v)
Re: car respawn command doesn't working? -
JasonRiggs - 06.06.2017
Code:
COMMAND:rac(playerid, params[])
{
new string[128], sendername[MAX_PLAYER_NAME];
if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You must be logged in to use this.");
if(GetPVarInt(playerid, "Admin") >= 3)
{
for(new v = 1; v <= MAX_VEHICLES; v++)
{
new bool:despawn = true;
foreach(new i : Player)
{
if(IsPlayerInAnyVehicle(i) && GetPlayerVehicleID(i) == v)
{
despawn = false;
}
}
if(despawn == true)
{
DespawnVehicle(v);
}
}
format(sendername, sizeof(sendername), "%s", PlayerInfo[playerid][pUsername]);
GiveNameSpace(sendername);
format(string, sizeof(string), "All unused cars despawned by %s.", sendername);
SendClientMessageToAll(playerid,COLOR_WHITE,string);
}
else SendClientMessage(playerid, COLOR_ERROR, "You do not have access to this command!");
return 1;
This is to announce, about the wrong cmd thing, does all the other cmds show "wrong cmd" if u make it wrong?
Re: car respawn command doesn't working? -
Jefff - 06.06.2017
http://forum.sa-mp.com/showpost.php?...55&postcount=6