Clear weapons when exiting deathmatch, and deleting vehicle when not used - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Clear weapons when exiting deathmatch, and deleting vehicle when not used (
/showthread.php?tid=155151)
Clear weapons when exiting deathmatch, and deleting vehicle when not used -
craponnaruto - 17.06.2010
I have a vehicle spawn script on my server, and the vehicles that are spawned could cause a crash if spawned too much *we could have like 50 vehicles that aren\'t being used*, so I want to know how to make a vehicle delete itself when not being driven. I also want to know how to take away weapons when exiting a deathmatch area.
Re: Clear weapons when exiting deathmatch, and deleting vehicle when not used -
killer98p - 17.06.2010
Quote:
Originally Posted by craponnaruto
I also want to know how to take away weapons when exiting a deathmatch area.
|
I can answer only this question for the moment...
So all what you need is when someone exit DM e.g. /exitdm he will be teleported to a place with 100% health and armour or however you like so you need to GetPlayerWeapon from Player and this is easy.. Take a look at this basic code
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/exitdm", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,1415.11,1247.74,15.0);
ResetPlayerWeapons(playerid);
return 1;
}
return 0;
}
When player wish exit DM he types e.g. /exitdm and then he willl be SetPlayerPos(teleported) to the given coordinates(place) with all ResetPlayerWeapons(all weapons removed) and note it must be (playerid); if you want only if player exits the DM.
Hope helped you
Re: Clear weapons when exiting deathmatch, and deleting vehicle when not used -
craponnaruto - 17.06.2010
Thanks, I decided to make the vehicle spawn an admin only thing
Re: Clear weapons when exiting deathmatch, and deleting vehicle when not used -
Cameltoe - 17.06.2010
i guess what ur looking for is like a vehicle streamer.. when in range it creates the vehicle and while out of range it removes it
Re: Clear weapons when exiting deathmatch, and deleting vehicle when not used -
killer98p - 17.06.2010
Quote:
Originally Posted by craponnaruto
Thanks, I decided to make the vehicle spawn an admin only thing
|
No problem