SA-MP Forums Archive
help with my new FS - 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: help with my new FS (/showthread.php?tid=469572)



Marijuana - Reydifox - 13.10.2013

hi all,

i am doing new FS for samp "Mariuana Fields"
...
here is codehttp://pastebin.com/qKUXyZJL
all works fine if is field free show me dialog
PHP код:
ShowPlayerDialog(playerid,DIALOG_MARIJUANA_BUY,DIALOG_STYLE_MSGBOX,"Marijuana Field","Are you want buy this marijuana field for 60 000$?","Yes","No"); 
but when i bought it text label updated my name but when i went to other free field dont showed me DIALOG_MARIJUANA_BUY... nothing... and in my bought field too nothing may show this
PHP код:
PlayerInfo[playerid][Marijuana] += MarijuanaGrams[i];
                new 
str[50];
                
format(str,50,"You got %d grams of marijuana",MarijuanaGrams[i]);
                
GameTextForPlayer(playerid,str10005);
                
MarijuanaGrams[i] = 0
and add one gram of marijuana in one minute.

can someone help me? what is wrong... when it will be fixed ill submit topic Marijuana FS with your help thank



Re: help with my new FS - DanishHaq - 13.10.2013

From the second code, try this instead:

pawn Код:
PlayerInfo[playerid][Marijuana] += MarijuanaGrams[i];
                new str[50];
                format(str,50,"You got %d grams of marijuana",MarijuanaGrams[i]);
                GameTextForPlayer(playerid,str, 1000, 5);
I removed this:

pawn Код:
MarijuanaGrams[i] = 0;
Which resets the player's quantity of Marijuana back to 0 automatically, you don't need that.


Re: help with my new FS - Reydifox - 14.10.2013

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
From the second code, try this instead:

pawn Код:
PlayerInfo[playerid][Marijuana] += MarijuanaGrams[i];
                new str[50];
                format(str,50,"You got %d grams of marijuana",MarijuanaGrams[i]);
                GameTextForPlayer(playerid,str, 1000, 5);
I removed this:

pawn Код:
MarijuanaGrams[i] = 0;
Which resets the player's quantity of Marijuana back to 0 automatically, you don't need that.
no its not the problem it works good... problem is that when i bought field is not save only update text label and when i pickup in field N.0... i got nothing but in field 19 where is Nobody i got marijuana grams.... SO?


Re: help with my new FS - Reydifox - 15.10.2013

Nobody?


Re: help with my new FS - iJumbo - 15.10.2013

Show the whole code in DIALOG_MARIJUANA_BUY


Re: help with my new FS - Reydifox - 15.10.2013

here is code of all... http://pastebin.com/qKUXyZJL

but is missing includes.. because fist i making it for gamemode


Re: help with my new FS - iJumbo - 15.10.2013

Is file saving when you buy ? like Real_World/Marijuana/ID.txt


Re: help with my new FS - Reydifox - 15.10.2013

Quote:
Originally Posted by iJumbo
Посмотреть сообщение
Is file saving when you buy ? like Real_World/Marijuana/ID.txt
no this doesnt work too


Re: help with my new FS - iJumbo - 15.10.2013

Are you sure there is files? you create files if there is no file? or the dir patch is correct?


Re: help with my new FS - Reydifox - 15.10.2013

ah... stock CreateMarijuana works fine

Marijuana folder exist and after first luch files will be created Real_World/Marijuana/0.txt
Real_World/Marijuana/1.txt ... Real_World/Marijuana/19.txt