weapon save
#1

Hey guys. I'm using a script that save things. Money and score saves correctly
But now I wanna know how to save your waepons on relog
The working things:
At public OnPlayerConnect

GivePlayerMoney(playerid, dUserINT(PlayerName2(playerid)).("money"));
SetPlayerScore(playerid, dUserINT(PlayerName2(playerid)).("score"))


Public OnplayerDisconncet

dUserSetINT(PlayerName2(playerid)).("score",GetPla yerScore(playerid));
dUserSetINT(PlayerName2(playerid)).("weapons",GetP layerWeapon(playerid));

now how to do weapons? PLease help
Reply
#2

pawn Код:
new weap0, ammo0, weap1, ammo1, weap2, ammo2, weap3, ammo3, weap4, ammo4, weap5, ammo5;
    GetPlayerWeaponData(playerid,0,weap0,ammo0);
    GetPlayerWeaponData(playerid,1,weap1,ammo1);
    GetPlayerWeaponData(playerid,2,weap2,ammo2);
    GetPlayerWeaponData(playerid,3,weap3,ammo3);
    GetPlayerWeaponData(playerid,4,weap4,ammo4);
    GetPlayerWeaponData(playerid,5,weap5,ammo5);

    dUserSetINT(PlayerName(playerid)).("Fist",weap0);
    dUserSetINT(PlayerName(playerid)).("Fistammo",ammo0);
    dUserSetINT(PlayerName(playerid)).("Melee",weap1);
    dUserSetINT(PlayerName(playerid)).("Meleeammo",ammo1);
    dUserSetINT(PlayerName(playerid)).("Pistol",weap2);
    dUserSetINT(PlayerName(playerid)).("Pistolammo",ammo2);
    dUserSetINT(PlayerName(playerid)).("Shotgun",weap3);
    dUserSetINT(PlayerName(playerid)).("Shotgunammo",ammo3);
    dUserSetINT(PlayerName(playerid)).("Smg",weap4);
    dUserSetINT(PlayerName(playerid)).("Smgammo",ammo4);
    dUserSetINT(PlayerName(playerid)).("Rifle",weap5);
    dUserSetINT(PlayerName(playerid)).("Rifleammo",ammo5);
Just something I had on my computer.
You can put that under OnPlayerDisconnect and under OnPlayerDeath
Reply
#3

doesnt work for me
Reply
#4

Could you be a little more clear please?
What doesn't work about it? :/
Reply
#5

Код:
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(966) : error 017: undefined symbol "PlayerName"
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(967) : error 017: undefined symbol "PlayerName"
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(968) : error 017: undefined symbol "PlayerName"
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(969) : error 017: undefined symbol "PlayerName"
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(970) : error 017: undefined symbol "PlayerName"
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(971) : error 017: undefined symbol "PlayerName"
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(972) : error 017: undefined symbol "PlayerName"
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(973) : error 017: undefined symbol "PlayerName"
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(974) : error 017: undefined symbol "PlayerName"
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(7365) : warning 219: local variable "weap1" shadows a variable at a preceding level
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(7365) : warning 219: local variable "ammo1" shadows a variable at a preceding level
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(7365) : warning 219: local variable "weap2" shadows a variable at a preceding level
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(7365) : warning 219: local variable "ammo2" shadows a variable at a preceding level
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(7365) : warning 219: local variable "weap3" shadows a variable at a preceding level
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(7365) : warning 219: local variable "ammo3" shadows a variable at a preceding level
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(7365) : warning 219: local variable "weap4" shadows a variable at a preceding level
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(7365) : warning 219: local variable "ammo4" shadows a variable at a preceding level
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(7365) : warning 219: local variable "weap5" shadows a variable at a preceding level
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(7365) : warning 219: local variable "ammo5" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


12 Errors.
Reply
#6

Add this:
pawn Код:
stock PlayerName(playerid) {
 new name[24];
 GetPlayerName(playerid, name, 24);
 return name;
}
And about the warnings, you already have those things in your script, or you did something wrong.
Reply
#7

i need the same xd
Reply
#8

C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(726) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
C:\Users\Bart\Desktop\samp server\gamemodes\GF.pwn(839) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)