Variables Question
#1

Well guys i am making a locker system witch includes storing Weapons Materials and Drugs and im not good with variables so i have my doubts since i never really messed before ok im using a command /locker with strcmp for [store|take] then [weapons|mats|drugs]
ok well the deal is that is it possible to save on this file
Код:
 PlayerInfo[playerid][pLockerSlot] = 0;
do you guys know how to use same lockerslot to save a variable wich right now 0 be replaced with the weapon id so i got it working with guns until now is it possible to do something like

Код:
PlayerInfo[playerid][pLockerSlot] = word Ammount; //Replace the 0 with the word Materials/Drugs and the ammount Example
PlayerInfo[playerid][pLockerSlot] = Materials 5000; how do i make it read so materials dosent get buged with weapons id wich will mess the code up and make it work as materials ? so when i take that locker slot it gives me the right thing either weapons materials or drugs
i hope you understand and please help me
Reply
#2

lol , you need each variabile for each type ... e.g:

you can use 2D Array

at pInfo

pawn Код:
pLockerSlot[4],/*0 - Weapon id; 1 - Bullets; 2 - Drugs; 3 - Materials
and at that command , use the correct syntax for the correct item

if you want to add some mats ...

pawn Код:
PlayerInfo[playerid][pLockerSlot][3] += mats;
etc.
Reply
#3

do you dont get it well sorta the problem here is can you give me a example a better one or tell me what exactly to do to get it working? this is what im trying to do now but im fallin lmao!!!

Код:
else if(PlayerInfo[playerid][pLockerSlot5] == 0 )//lockerslot5
				  {
					  new Matsa = PlayerInfo[playerid][pMatsA];
				    ammount = strval(tmp);
            PlayerInfo[playerid][pMatsA] -= Matsa ammount;
            PlayerInfo[playerid][pLockerSlot5] += ammount;
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s places some mats in their locker.", sendername);
	          ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
 	          format(string, sizeof(string), "You have stored %d A mats in your locker.", ammount);
	          SendClientMessage(playerid, COLOR_GREY, string);
            return 1;
          }
that code i use checks for the lockerslot thats free and store the item so can you correct this for me? im falling hard lol
Reply


Forum Jump:


Users browsing this thread: