Forum

> > CS2D > Scripts > Just Some Scripts needed
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Just Some Scripts needed

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Just Some Scripts needed

Man Of Steel
User Off Offline

Zitieren
Hi everyone,

I'm always glad,whenever i'm ask any problem here, and he solved always.

Today, i want an script maybe anyone can make for me :P,

I want that when anybody left the game so his all items are dropped in server/map and others players can take it.

And I've another request, i want that Npc are only attack
Terrorist,but don't gotta for Counter-Terrorist, Specially Solider npcs

I shall be very happy if you are help me for this matter.

Thanks for attention,

alt Re: Just Some Scripts needed

GeoB99
Moderator Off Offline

Zitieren
For the first script, I would go by checking the items that a player carries by using cs2d lua cmd playerweapons, check their position and spawn them using cs2d cmd spawnitem approach. To sum all up, here's the code:
1
2
3
4
5
6
7
8
9
10
function DropWeaponsOnLeave(id, reason)
  for _, DropItem in pairs( playerweapons(id) ) do

    local GetItemPos = {player(DropItem, 'tilex'), player(DropItem, 'tiley')}

    parse('spawnitem ' .. GetItemPos[1] .. ' ' .. GetItemPos[2])
  end
end

addhook('leave', 'DropWeaponsOnLeave')
Beware that it is not guaranteed my approach may work but give it a try. If bugs occur within the console, please post them.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht