SA-MP Forums Archive
Spawning with the saved weapons. - 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: Spawning with the saved weapons. (/showthread.php?tid=204650)



Spawning with the saved weapons. - Ihsan-Cingisiz - 30.12.2010

Hello,
I made this in OnPlayerDisconnect, it saves the weapon that a player have
by disconnecting, i want to spawn with the saved weapon but i don't exactly
know how to do it.

OnPlayerDisconnect:
Код:
    new weapons[13][2];
    for (new i = 0; i < 13; i++) GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
    dini_IntSet(bestand, "weaponSlot0", weapons[0][0]);
    dini_IntSet(bestand, "weaponSlot0Ammo", weapons[0][1]);
    dini_IntSet(bestand, "weaponSlot1", weapons[1][0]);
    dini_IntSet(bestand, "weaponSlot1Ammo", weapons[1][1]);
    dini_IntSet(bestand, "weaponSlot2", weapons[2][0]);
    dini_IntSet(bestand, "weaponSlot2Ammo", weapons[2][1]);
    dini_IntSet(bestand, "weaponSlot3", weapons[3][0]);
    dini_IntSet(bestand, "weaponSlot3Ammo", weapons[3][1]);
    dini_IntSet(bestand, "weaponSlot4", weapons[4][0]);
    dini_IntSet(bestand, "weaponSlot4Ammo", weapons[4][1]);
    dini_IntSet(bestand, "weaponSlot5", weapons[5][0]);
    dini_IntSet(bestand, "weaponSlot5Ammo", weapons[5][1]);
    dini_IntSet(bestand, "weaponSlot6", weapons[6][0]);
    dini_IntSet(bestand, "weaponSlot6Ammo", weapons[6][1]);
    dini_IntSet(bestand, "weaponSlot7", weapons[7][0]);
    dini_IntSet(bestand, "weaponSlot7Ammo", weapons[7][1]);
    dini_IntSet(bestand, "weaponSlot8", weapons[8][0]);
    dini_IntSet(bestand, "weaponSlot8Ammo", weapons[8][1]);
    dini_IntSet(bestand, "weaponSlot9", weapons[9][0]);
    dini_IntSet(bestand, "weaponSlot8Ammo", weapons[9][1]);
    dini_IntSet(bestand, "weaponSlot10", weapons[10][0]);
    dini_IntSet(bestand, "weaponSlot10Ammo", weapons[10][1]);
    dini_IntSet(bestand, "weaponSlot11", weapons[11][0]);
    dini_IntSet(bestand, "weaponSlot11Ammo", weapons[11][1]);
    dini_IntSet(bestand, "weaponSlot12", weapons[12][0]);
    dini_IntSet(bestand, "weaponSlot12Ammo", weapons[12][1]);
What should i do under OnPlayerSpawn to load all these weapon if saved?

I hope this info. was enough, if not.. Ask

Kind regards,
I. C.


Re: Spawning with the saved weapons. - _rAped - 30.12.2010

GiveWeapon and foreach on OnPlayerSpawn?


Re: Spawning with the saved weapons. - Ihsan-Cingisiz - 30.12.2010

Quote:
Originally Posted by _rAped
Посмотреть сообщение
GiveWeapon and foreach on OnPlayerSpawn?
Can you give me the script, i'm pretty new so i don't exactly know what you mean.

Regards,
I. c.