Szerző Téma: Fegyver Cuccocska  (Megtekintve 426 alkalommal)

Fegyver Cuccocska
« Dátum: 2016. szeptember 04. - 13:34:39 »
0 Show voters
Sziasztok, így mentettem a fegyvereket, lenne egy olyan kérdésem, hogy ezt hogyan tudom úgy oda adni a játékosnak spawnoláskor, hogy örök töltény legyen és oda is adja neki a fegyvert?

GetPlayerName(playerid,Nev,sizeof(Nev));
format(str, 128, \"Karik/%s.ini\", Nev);
if(Belepve[playerid] == 1)
{
dfile_Open(str);
    dfile_WriteInt(\"Brass Knuckles\", GetPVarInt(playerid, \"Brass Knuckles\"));
    dfile_WriteInt(\"Golf Club\", GetPVarInt(playerid, \"Golf Club\"));
    dfile_WriteInt(\"Nightstick\", GetPVarInt(playerid, \"Nightstick\"));
    dfile_WriteInt(\"Knife\", GetPVarInt(playerid, \"Knife\"));
    dfile_WriteInt(\"Baseball Bat\", GetPVarInt(playerid, \"Baseball Bat\"));
    dfile_WriteInt(\"Shovel\", GetPVarInt(playerid, \"Shovel\"));
    dfile_WriteInt(\"Pool Cue\", GetPVarInt(playerid, \"Pool Cue\"));
    dfile_WriteInt(\"Shovel\", GetPVarInt(playerid, \"Shovel\"));
    dfile_WriteInt(\"Katana\", GetPVarInt(playerid, \"Katana\"));
    dfile_WriteInt(\"Chainsaw\", GetPVarInt(playerid, \"Chainsaw\"));
    dfile_WriteInt(\"Purple Dildo\", GetPVarInt(playerid, \"Purple Dildo\"));
    dfile_WriteInt(\"Dildo\", GetPVarInt(playerid, \"Dildo\"));
    dfile_WriteInt(\"Vibrator\", GetPVarInt(playerid, \"Vibrator\"));
    dfile_WriteInt(\"Silver Vibrator\", GetPVarInt(playerid, \"Silver Vibrator\"));
    dfile_WriteInt(\"Flowers\", GetPVarInt(playerid, \"Flowers\"));
    dfile_WriteInt(\"Cane\", GetPVarInt(playerid, \"Cane\"));
    dfile_WriteInt(\"Tear Gas\", GetPVarInt(playerid, \"Tear Gas\"));
    dfile_WriteInt(\"RPG\", GetPVarInt(playerid, \"RPG\"));
    dfile_WriteInt(\"HS Rocket\", GetPVarInt(playerid, \"HS Rocket\"));
    dfile_WriteInt(\"Flamethrower\", GetPVarInt(playerid, \"Flamethrower\"));
    dfile_WriteInt(\"Satchel Charge\", GetPVarInt(playerid, \"Satchel Charge\"));
    dfile_WriteInt(\"Spraycan\", GetPVarInt(playerid, \"Spraycan\"));
    dfile_WriteInt(\"Fire Extinguisher\", GetPVarInt(playerid, \"Fire Extinguisher\"));
    dfile_WriteInt(\"Camera\", GetPVarInt(playerid, \"Camera\"));
    dfile_WriteInt(\"Night Vis Goggles\", GetPVarInt(playerid, \"Night Vis Goggles\"));
    dfile_WriteInt(\"Thermal Goggles\", GetPVarInt(playerid, \"Thermal Goggles\"));
    dfile_WriteInt(\"Grenade\", GetPVarInt(playerid, \"Grenade\"));
    dfile_WriteInt(\"Molotov Cocktail\", GetPVarInt(playerid, \"Molotov Cocktail\"));
    dfile_WriteInt(\"9mm\", GetPVarInt(playerid, \"9mm\"));
    dfile_WriteInt(\"Silenced 9mm\", GetPVarInt(playerid, \"Silenced 9mm\"));
    dfile_WriteInt(\"Desert Eagle\", GetPVarInt(playerid, \"Desert Eagle\"));
    dfile_WriteInt(\"Shotgun\", GetPVarInt(playerid, \"Shotgun\"));
    dfile_WriteInt(\"Sawn-off Shotgun\", GetPVarInt(playerid, \"Sawn-off Shotgun\"));
    dfile_WriteInt(\"Combat Shotgun\", GetPVarInt(playerid, \"Combat Shotgun\"));
    dfile_WriteInt(\"Micro SMG/Uzi\", GetPVarInt(playerid, \"Micro SMG/Uzi\"));
    dfile_WriteInt(\"MP5\", GetPVarInt(playerid, \"MP5\"));
    dfile_WriteInt(\"AK-47\", GetPVarInt(playerid, \"AK-47\"));
    dfile_WriteInt(\"M4\", GetPVarInt(playerid, \"M4\"));
    dfile_WriteInt(\"Tec-9\", GetPVarInt(playerid, \"Tec-9\"));
    dfile_WriteInt(\"Country Rifle\", GetPVarInt(playerid, \"Country Rifle\"));
    dfile_WriteInt(\"Sniper Rifle\", GetPVarInt(playerid, \"Sniper Rifle\"));
    dfile_WriteInt(\"Minigun\", GetPVarInt(playerid, \"Minigun\"));
//
dfile_SaveFile();
dfile_CloseFile();

 
Fegyver adás(Csak így nem adja oda spawnoláskor sajnos mert én névvel mentettem :( ):
 
stock GivePlayerServerWeapon(playerid, weapid, ammo)
{
    new gunname[32];
    GivePlayerWeapon(playerid, weapid, ammo);
    GetWeaponName(weapid, gunname, sizeof(gunname));
    SetPVarInt(playerid, gunname, ammo);
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal