Fegyver eldobó script

Indította Sramm, 2011. november 17. - 13:36:14

Előző téma - Következő téma

Sramm

Sziasztok! Egy régebbi scriptem szeretném nektek publikálni:
Funkció: Amikor a játékos meghal, eldobja a fegyverét pickup formájában, és egy másik játékos pedig felveheti.
Tapasztalat: Az egész tesztelve, mûködik.
Bugok,hibák: Csak azt dobja el ami a kezedben van. Még egy: /kill parancsnál nem fog mûködni! Csak \"természetes\" halálnál!
Forráskód:
[pawn]#include <a_samp>
public OnFilterScriptInit()
{
   print(\"\\n--------------------------------------\");
   print(\" Fegyver eldobás by Sramm\");
   print(\"--------------------------------------\\n\");
   return 1;
}
stock GetPlayerWeaponModell(playerid,modell)
{
new weaponid;
weaponid = GetPlayerWeapon(playerid);
switch(weaponid)
{
     case 0: modell = 0;
     case 1: modell = 331;
     case 2: modell = 333;
     case 3: modell = 334;
     case 4: modell = 335;
     case 5: modell = 336;
     case 6: modell = 337;
     case 7: modell = 338;
     case 8: modell = 339;
     case 9: modell = 341;
     case 10: modell = 321;
     case 11: modell = 322;
     case 12: modell = 323;
     case 13: modell = 324;
     case 14: modell = 325;
     case 15: modell = 326;
     case 16: modell = 342;
     case 17: modell = 343;
     case 18: modell = 344;
     case 19: modell = 0;
     case 20: modell = 0;
     case 21: modell = 0;
     case 22: modell = 345;
     case 23: modell = 346;
     case 24: modell = 347;
     case 25: modell = 348;
     case 26: modell = 349;
     case 27: modell = 350;
     case 28: modell = 351;
     case 29: modell = 352;
     case 30: modell = 353;
     case 31: modell = 356;
     case 32: modell = 372;
     case 33: modell = 357;
     case 34: modell = 358;
     case 35: modell = 359;
     case 36: modell = 360;
     case 37: modell = 361;
     case 38: modell = 362;
     case 39: modell = 363;
     case 40: modell = 364;
     case 41: modell = 365;
     case 42: modell = 366;
     case 43: modell = 367;
     case 44: modell = 368;
     case 45: modell = 369;
     case 46: modell = 371;
   }
   return modell;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new fegyverid;
fegyverid = GetPlayerWeaponModell(playerid,fegyverid);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
AddStaticPickup(fegyverid, 15, x,y,z); // fegyó lerakás
SendClientMessageToAll(0xFF66FFAA,\"Valaki meghalt, és eldobta minden fegyverét.\");
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
DestroyPickup(pickupid);
return 1;
}
public OnFilterScriptExit()
{
   return 1;
}
[/pawn]

Dead

Úhhh :DDD THX
Ilyet Kerestem már mióta :)
ment a Like

Sramm

Örülök, hogy segítettem :)

]XziBiT[


kadaradam

public OnPlayerPickUpPickup(playerid, pickupid)
{
DestroyPickup(pickupid);
return 1;
}
 
[/quote]
Ez így nem elsz jó mert ha bármelyik pickupba belemegy akkor is törli!
szóval:
[pawn]
new weapon;
weapon = AddStaticPickup(.....);
DestoyPickup(weapon);[/pawn]

Sramm

Az úgy nem jó, mert akkor mindig csak 1 pickup lesz...

szabyxxx

Kössz Beleépitettem a módba :)

IXT


[(The_Pro_Kari)]

#8
jó lett grat :D

BoOy

#9
Jó lett ment a tisztelet.
[mod]Ne itt reklámozd!![/mod]

Sheet

Idézetet írta: Sramm date=1321718185\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"13471\" data-ipsquote-contentclass=\"forums_TopicAz úgy nem jó, mert akkor mindig csak 1 pickup lesz...
 
Hozd létre tömbként, és adj a tömbe neki +1 helyet mindig.

Swat