SA-MP Forums Archive
Random Money! - 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: Random Money! (/showthread.php?tid=649056)



Random Money! - Thanks - 02.02.2018

Hi I've adding a random money after someone robbing something else. but Random money is worked but.. After the robbing finished they told you Example: You have collect $450000 You must go to checkpoint to completed this robbery. After the player goto to Checkpoint they are not given him $450000 they give him any Random money why?

PHP код:
new mrand =random(200000);
             
format(string,sizeof(string),"{FFD700}%s(%d) {FFFFFF}has stolen Casino Chips worth {33FF33}$%d {FFFFFF}from {EDED05}Four Dragon Casino{FFFFFF}.",pName,i,mrand); 
And after player goto checkpoint

PHP код:
        new mrand =random(200000);
        
format(string,sizeof(string),"[FourDragonCasino Robbery]: %s(%d) has stolen {33FF33}$%d {E87400}split stolen from the FourDragon Casino.",pName,i,mrand);
        
SendClientMessageToAll(COLOR_ORANGE,string);
        
GivePlayerMoney(imrand); 



Re: Random Money! - issac - 02.02.2018

Can you show a bit more code it has to do something regarding the way you used i


Re: Random Money! - Mugala - 02.02.2018

if u're using random code for 2 times, than u must use it one time and save it anywhere, from example u must this first random generated number in PVar (SetPVarInt(playerid,"RandomMoney"); and than when he reaches the checkpoint, u must give him this RandomMoney (GivePlayerMoney(playerid,GetPVarInt(playerid,"Ran domMoney"));

if u have not this issue, show us more code.


Re: Random Money! - jasperschellekens - 02.02.2018

PHP код:
New RandomRobMoney[MAX_PLAYERS];
/////
new mrand =random(200000); 
format(string,sizeof(string),"{FFD700}%s(%d) {FFFFFF}has stolen Casino Chips worth {33FF33}$%d {FFFFFF}from {EDED05}Four Dragon Casino{FFFFFF}.",pName,i,mrand);  
RandomRobMoney[playerid] = mrand;
//
 
GivePlayerMoney(playeridRandomRobMoney[playerid]); 
Should work didnt test it, typed this on my phone