SA-MP Forums Archive
Pickup problem - 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: Pickup problem (/showthread.php?tid=612122)



ResetPlayerWeapons - Rockyyy - 14.07.2016

I'm making WP system in dialog and in response some i resetplayerweapons it only work for the first 4 cases (0 1 2 3) but it doesn't reset weapons in case 4
Код:
case 0:
 {
             ResetPlayerWeapons(playerid);
	    GivePlayerWeapon(playerid, 24, 500);
}

 case 1:
   {

	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid, 26, 900);
   }
case 2:
 {					
                       ResetPlayerWeapons(playerid);
		GivePlayerWeapon(playerid, 38, 99999999);
     }
 case 3:
{
		ResetPlayerWeapons(playerid);
		GivePlayerWeapon(playerid, 4, 1); //Knife.
}
	
case 4:
{
		ResetPlayerWeapons(playerid);
	     GivePlayerWeapon(playerid,43,1);
 }
At case 4 it only give weapon and doesn't reset please help i need it fast


Re: Pickup problem - Rockyyy - 14.07.2016

EDITED - please check


Re: Pickup problem - GangstaSunny - 14.07.2016

Hello Rockyyy,
try to use our code like the code below.

PHP код:
ResetPlayerWeapons(playerid);
case 
0:{GivePlayerWeapon(playerid24500);}
case 
1:{GivePlayerWeapon(playerid26900);}
case 
2:{GivePlayerWeapon(playerid3899999999);}
case 
3:{GivePlayerWeapon(playerid41);}
case 
4:{GivePlayerWeapon(playerid,43,1);} 



Re: Pickup problem - WhiteGhost - 14.07.2016

Quote:
Originally Posted by GangstaSunny
Посмотреть сообщение
Hello Rockyyy,
try to use our code like the code below.

PHP код:
ResetPlayerWeapons(playerid);
case 
0:{GivePlayerWeapon(playerid24500);}
case 
1:{GivePlayerWeapon(playerid26900);}
case 
2:{GivePlayerWeapon(playerid3899999999);}
case 
3:{GivePlayerWeapon(playerid41);}
case 
4:{GivePlayerWeapon(playerid,43,1);} 
Was just going to do this


Re: Pickup problem - Rockyyy - 14.07.2016

Im using these codes under ondialogresponse

if(response)
{
switch(dialogid)
{
case 90:
{
switch(listitem)
{


Re: Pickup problem - Rockyyy - 14.07.2016

I fixed it ,
instead of having
Код:
ResetPlayerWeapons(playerid);
I made it like that
Код:
ResetPlayerWeapons(playerid);
ResetPlayerWeapons(playerid);
and it worked....... can someone tell me the reason why i have to duplicate my code so it works?!


Re: Pickup problem - GangstaSunny - 14.07.2016

Technical issue. Dont ask. Just deal with it. Like Microsoft.