Random Money!
#1

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); 
Reply
#2

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

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.
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)