[Help] Saving Weapons
#2

pawn Код:
stock LoadWeapons(playerid){
    new pname[MAX_PLAYER_NAME];
    if(!GetPlayerName(playerid, pname, MAX_PLAYER_NAME)) return false;
    if(!udb_Exists(pname)) udb_Create(pname, "");
    for(new wep[8], amm[6], i; i < 13; i++){
        format(amm, sizeof amm, "Ammo%d", i);format(wep, sizeof wep, "Weapon%d", i);GivePlayerWeapon(playerid, dUserINT(pname).(wep), dUserINT(pname).(amm));
    }
    return true;
}
stock SaveWeapons(playerid){
    new pname[MAX_PLAYER_NAME];
    if(!GetPlayerName(playerid, pname, MAX_PLAYER_NAME)) return false;
    if(!udb_Exists(pname)) udb_Create(pname, "");
    for(new wep[8], amm[6], i, cwep, camm; i < 13; i++){
        format(amm, sizeof amm, "Ammo%d", i);format(wep, sizeof wep, "Weapon%d", i);GetPlayerWeaponData(playerid, i, cwep, camm);
        dUserSetINT(pname).(amm, camm);dUserSetINT(pname).(wep, cwep);
    }
    return true;
}
the code is not mine! i found it somewhere on samp forum, sry dunno where it was.. long time ago..
but here you go..i assuem you know how to use it?.. in onplayerspawn, onplayerdisconnect.. etc
Reply


Messages In This Thread
[Help] Saving Weapons - by Nakash - 26.08.2009, 03:26
Re: [Help] Saving Weapons - by Gamer_Z - 26.08.2009, 06:19
Re: [Help] Saving Weapons - by Nakash - 26.08.2009, 06:26
Re: [Help] Saving Weapons - by Gamer_Z - 26.08.2009, 06:32
Re: [Help] Saving Weapons - by Nakash - 26.08.2009, 06:34
Re: [Help] Saving Weapons - by dice7 - 26.08.2009, 08:11
Re: [Help] Saving Weapons - by Nakash - 26.08.2009, 14:50
Re: [Help] Saving Weapons - by Gamer_Z - 26.08.2009, 15:09
Re: [Help] Saving Weapons - by Nakash - 26.08.2009, 16:08
Re: [Help] Saving Weapons - by snoob - 27.08.2009, 03:37

Forum Jump:


Users browsing this thread: 11 Guest(s)