SA-MP Forums Archive
Weapons dissappear after spawning them - 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)
+--- Thread: Weapons dissappear after spawning them (/showthread.php?tid=361386)



Weapons dissappear after spawning them - Devix - 20.07.2012

So, when I give a player a weapon, it pops up and deleted right after.
It worked perfectly fine before, what went wrong? What could create this bug?


Re: Weapons dissappear after spawning them - [IKS]Niko_Hs™ - 20.07.2012

It is possible that there is a script that performs this action, post your complete callback OnPlayerUpdate.
There will certainly be a script that is in conflict


Re: Weapons dissappear after spawning them - Cxnnor - 20.07.2012

pawn Код:
else if(!strcmp(cmdtext,"/command",true))
    {
        GivePlayerWeapon(playerid, //weaponid, //weaponammo);
        return 1;
    }
pawn Код:
CMD:command(playerid, params[])
    {
        GivePlayerWeapon(playerid, //weaponid, //weaponammo);
        return 1;
    }



Re: Weapons dissappear after spawning them - [KHK]Khalid - 20.07.2012

Quote:
Originally Posted by Cxnnor
Посмотреть сообщение
pawn Код:
else if(!strcmp(cmdtext,"/command",true))
    {
        GivePlayerWeapon(playerid, //weaponid, //weaponammo);
        return 1;
    }
pawn Код:
CMD:command(playerid, params[])
    {
        GivePlayerWeapon(playerid, //weaponid, //weaponammo);
        return 1;
    }
He already knows how to give a weapon. If you had read his first post, you could have understood what the issue is.


Well Devix you might check all the scripts you use for ResetPlayerWeapons inside repeatedly timers or under OnPlayerUpdate then take it out.


Edit:

Do you remember what have you done (Added/Removed/Modified) in your script right before that issue came up?


Re: Weapons dissappear after spawning them - Devix - 22.07.2012

Well I messed around with SpawnInfo, seeing my skinID didn't save before (does now though, without the spawninfo functions). I basically got rid of all the spawninfo functions (seeing it may have prevented the weapons to spawn at login) but the issue is still there.


Re: Weapons dissappear after spawning them - Devix - 22.07.2012

Anyone please?

This is the only bit where the function ResetPlayerweapons is called.

Код:
public LoadWeapons(playerid)
{
	new i, path[50], string[128], weaponid, ammo;
    path = GetPlayerFormattedName(playerid);
    ResetPlayerWeapons(playerid);
    for (i=0; i<13; i++)
    {
    	format(string,sizeof(string),"Weapon - %d",i);
    	weaponid = dini_Int(path,string);
    	format(string,sizeof(string),"AmmoID - %d",i);
    	ammo = dini_Int(path,string);
    	GivePlayerWeapon(playerid,weaponid,ammo);
    }
    AlreadyGiveWeapons[playerid] = true;
}
But as I said, worked before.


Re: Weapons dissappear after spawning them - Devix - 24.07.2012

Anyone? Please!!