[FilterScript] Respawncars - 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: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Respawncars (
/showthread.php?tid=547552)
Respawncars -
JaydenJason - 23.11.2014
This was my first little script I made in a long while ago, meanwhile I've advanced in scripting and I had published this as I roam around quite some servers, and most of the times all the vehicles are in the most idiotic places, 50 vehicles in a small place, that's why I made this quick little thing to respawn those vehicles.
PHP код:
CMD:respawncars(playerid, params[])
{
if(IsPlayerAdmin(playerid)) // var can be changed
{
new Float:X, Float:Y, Float:Z, distance;
if(sscanf(params, "d", distance)) distance = 10;
for(new i = 0; i < MAX_VEHICLES; i++)
{
GetVehiclePos(i, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, distance, X, Y, Z))
{
SetVehicleToRespawn(i);
}
}
}
return 1;
}
Pastebin:
http://pastebin.com/1WfF9MEc
Re: Respawncars -
LeXuZ - 23.11.2014
Cool command, could come in useful when having a load of vehicles in a small space, nice work
Re: Respawncars -
jamjamnewbie - 23.11.2014
Based on your command, I assume there's no need for foreach.inc?
Re: Respawncars -
JaydenJason - 23.11.2014
Quote:
Originally Posted by jamjamnewbie
Based on your command, I assume there's no need for foreach.inc?
|
yeppers, apologies
Re: Respawncars -
N.K.Stallone - 23.11.2014
Not bad, keep learning!
Re: Respawncars -
M0HAMMAD - 23.11.2014
nice command. it's good.
Re: Respawncars -
JaydenJason - 24.11.2014
Quote:
Originally Posted by bgtracker
Not bad, keep learning! ![Smiley](images/smilies/smile.png)
|
Quote:
Originally Posted by M0HAMMAD
nice command. it's good.
|
Cheers, more motivation for me to continue scripting
Re: Respawncars -
UltraScripter - 28.12.2014
Easy but good!