SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 28/11/2013, 08:49 PM   #1
Chrisli520
Big Clucker
 
Join Date: May 2013
Posts: 53
Reputation: 0
Default bag system error, item can only replace the item on slop 0

what i want is that player can use /putin to putin their wepon in to bag. but the code makes is i type /putin, the item that on my slop 0 (bag)will change to the weapon on my hand, but not add on.

here is code

Code:
if(!strcmp(cmd, "/putin", true)) 
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "** Login First !");
                return 1;
            }
			if(PlayerInfo[playerid][pDuty] == 1)
			{
			    SendClientMessage(playerid, COLOR_GRAD2, "** You are not able to do so");
			    return 1;
			}
			for(new i = 0; i < 31; i++)
			{
				if(baoguo[playerid][i][bID] == 0)
				{
				    new gunname[128];
				    new gunID = GetPlayerWeapon(playerid);
				    baoguo[playerid][i+1][bID] = gunID;
				    baoguo[playerid][i+1][bAmount] = 1;
					RemovePlayerWeapon(playerid, gunID);
					GetWeaponName(gunID, gunname, sizeof(gunname));
	                format(string, sizeof(string), "** You had put your gun  %s into your bag.", gunname);
					SendClientMessage(playerid, COLOR_ORANGE, string);
					format(string, sizeof(string), "* %s put his gun %s into the bag.", sendername,gunname);
		    		ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
		    		//savebaoguo(playerid);
		    		return 1;
				}
			}
		}
    }
here is the command for open my bag

Code:
if(strcmp(cmd, "/bag", true) == 0)
	{
		if (IsPlayerConnected(playerid))
		{
	    	if(IsPlayerConnected(playerid))
	    	{
	    	    new string[328];
	    	    for(new i = 0; i < 31; i++)
				{
				    if(baoguo[playerid][i][bID] != 0)
				    {
				        new ps[128];
				        new gunname[128];
				        GetWeaponName(baoguo[playerid][i][bID],gunname,128);
				        format(string,328,"|{FF6699}x|    |name		| Amount |\n");
				        format(ps,128,"|{FFFF66}%d|    |%s	| %d |\n",baoguo[playerid][i][bID],gunname,baoguo[playerid][i][bAmount]);
						strcat(string, ps);
					}
				}
				ShowPlayerDialog(playerid, 3163, DIALOG_STYLE_LIST,"Bag",string,"select","cancel");
				return 1;
			}
		}
	}
Chrisli520 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Pedido] ID de item MTA 8235Danilo PortuguÍs/Portuguese 2 17/08/2013 11:07 PM
Help with forbidden item iWaYz Scripting Help 10 15/04/2012 05:06 PM
how to add +1 item when ... hardstop Help Archive 2 27/04/2010 08:18 PM
how do i get this item? Drift_04 Help Archive 2 02/03/2009 12:30 AM


All times are GMT. The time now is 02:12 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.