public LoadWeapons(playerid) {
for (new i = 0; i < 13; i++) {
new tmp[10];
valstr(tmp,i);
new slot[10];
format(slot,10,"weapslot%s",tmp);
if (dUserINT(PlayerName(playerid)).(slot)!=0)
{
new ammo[10];
format(ammo,10,"weapammo%s",tmp);
GivePlayerWeapon(playerid,dUserINT(PlayerName(playerid)).(slot),dUserINT(PlayerName(playerid)).(ammo));
}
}
}
public OnPlayerDisconnect(playerid, reason)
{
if(Registered[playerid])
{
dUserSetINT(PlayerName(playerid)).("Money",GetPlayerMoney(playerid));
dUserSetINT(PlayerName(playerid)).("Kills",MyKills[playerid]);
dUserSetINT(PlayerName(playerid)).("Deaths",MyDeaths[playerid]);
dUserSetINT(PlayerName(playerid)).("Level",Level[playerid]);
dUserSetINT(PlayerName(playerid)).("Wantedlvl",GetPlayerWantedLevel(playerid));
dUserSetINT(PlayerName(playerid)).("LoggedIn",LoggedIn[playerid]=0);
dUserSetINT(PlayerName(playerid)).("Registered",Registered[playerid]);
new weapons[13][2];
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
if (weapons[i][0]!=0)
{
new tmp[10];
valstr(tmp,i);
new slot[10];
format(slot,10,"weapslot%s",tmp);
dUserSetINT(PlayerName(playerid)).(slot,weapons[i][0]);
new ammo[10];
format(ammo,10,"weapammo%s",tmp);
dUserSetINT(PlayerName(playerid)).(ammo,weapons[i][1]);
}
}
}
return 1;
}
public OnPlayerSpawn(playerid)
{
SetTimer("LoadWeapons",2000,0);
return 1;
}
Originally Posted by Jay_
Use GetPlayerWeaponData, ResetPlayerWeapons, and GivePlayerWeapon.
|
C:\Documents and Settings\Desktop\samp\filterscripts\RegServXA.pwn(76) : warning 235: public function lacks forward declaration (symbol "LoadWeapons")
C:\Documents and Settings\Desktop\samp\filterscripts\RegServXA.pwn(124) : warning 235: public function lacks forward declaration (symbol "InAreaCheck")
C:\Documents and Settings\Desktop\samp\filterscripts\RegServXA.pwn(152) : warning 235: public function lacks forward declaration (symbol "OutOfAreaCheck")
Originally Posted by Outbreak
I've got this exact thing you're talking about. I did it for a chill out safe zone and for a stint area so people couldn't use weapons in these areas and their weapons returned once they left the area.
I'll pm you with it when I get a chance. |