enough money
#1

in my gm if player have 5m and 2nd player rob it so they get like 1.5 or 2m money but i dnt like this shit,

i want make a enough money like if player have 10m or 100m or 5m but when you rob it so you get only 100k.
Reply
#2

Well, its up to the player how much the player robs, and the admin of the server, will maybe enforce a rule.

Such as ROb Limit: to 100k.
Reply
#3

i need add rob limit like this?

#define ROB_LIMIT 100000 ?? it worked?

you're good for explaination, sometime need to do. and you can''t because you're not good to do.

more comments pls i don't understand this^^^
Reply
#4

show us the rob command
Reply
#5

PHP код:
CMD:rob(playeridparams[])
    {
        new 
pname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridpnamesizeof(pname));
        if(!
strlen(params))
        {
            
SendClientMessage(playeridRED"USAGE: /rob [ID]");
        }
        else
        {
            
ID strval(params);
            if(
robtime[playerid] == 0)
            {
                if(
ID != playerid)
                {
                    if(
IsPlayerConnected(ID))
                    {
                        new 
oname[MAX_PLAYER_NAME];
                        
GetPlayerName(IDonamesizeof(oname));
                        if(
GetDistanceBetweenPlayers(playeridID) <= DISTANCE_BETWEEN_PLAYERS)
                        {
                            if(!
GetPlayerVehicleID(ID) || GetPlayerVehicleID(ID) == GetPlayerVehicleID(ID))
                            {
                                if(
GetPlayerCash(ID) > 0)
                                {
                                    new 
rob random(11);
                                    if(
rob == || rob == || rob == 10 || rob == 11)
                                    {
                                        new 
string[256];
                                        
format(stringsizeof(string), "%s (%i) noticed you trying to rob him. Attempt failed!",onameID);
                                        
SendClientMessage(playeridREDstring);
                                        
format(stringsizeof(string), "~w~%s Noticed you trying to rob him.~n~Attempt failed!.",onameID);
                                        
GameTextForPlayer(playeridstring50004);
                                        
GetPlayerName(playerid,pname,sizeof(pname));
                                        
format(stringsizeof(string), "You noticed %s (%i) trying to rob you. His attempt has failed!"pnameplayerid);
                                        
SendClientMessage(IDREDstring);
                                        
format(stringsizeof(string), "~w~You noticed %s trying to rob you.~n~His attempt has failed!"pnameplayerid);
                                        
GameTextForPlayer(IDstring50004);
                                    }
                                    else if(
rob == 3)
                                    {
                                        new 
pcash GetPlayerCash(ID);
                                        new 
robcash random(pcash);
                                        
GivePlayerCash(ID, -robcash);
                                        
GivePlayerCash(playeridrobcash);
                                        
GetPlayerName(playeridpnamesizeof(pname));
                                        new 
string[256];
                                        
format(stringsizeof(string), "You have robbed $%i from %s (%i)."robcashonameID);
                                        
SendClientMessage(playeridLIGHTGREENstring);
                                        
format(stringsizeof(string), "~w~Robbed $%i from %s."robcashoname);
                                        
GameTextForPlayer(playeridstring50004);
                                        
format(stringsizeof(string), "%s (%i) has robbed $%i from you."pnameplayeridrobcash);
                                        
SendClientMessage(IDREDstring);
                                        
format(stringsizeof(string), "~w~%s has robbed $%i from you."pnamerobcash);
                                        
GameTextForPlayer(IDstring50004);
                                    }
                                    else if(
rob == || rob == || rob == 8)
                                    {
                                        new 
pcash GetPlayerCash(ID);
                                        new 
robcash random(pcash);
                                        new 
robcash2 robcash-random(robcash);
                                        
GivePlayerCash(ID, -robcash2);
                                        
GivePlayerCash(playeridrobcash2);
                                        new 
string[256];
                                        
GetPlayerName(playeridpnamesizeof(pname));
                                        
format(stringsizeof(string), "You have robbed $%i from %s (%i)."robcash2onameID);
                                        
SendClientMessage(playeridLIGHTGREENstring);
                                        
format(stringsizeof(string), "~w~Robbed $%i from %s."robcash2oname);
                                        
GameTextForPlayer(playeridstring50004);
                                        
format(stringsizeof(string), "%s (%i) has robbed $%i from you."pnameplayeridrobcash2);
                                        
SendClientMessage(IDREDstring);
                                        
format(stringsizeof(string), "~w~%s has robbed $%i from you."pnamerobcash2);
                                        
GameTextForPlayer(IDstring50004);
                                    }
                                    else if(
rob == || rob == 7)
                                    {
                                        new 
pcash GetPlayerCash(ID);
                                        new 
robcash random(pcash);
                                        new 
robcash2 robcash-random(robcash);
                                        new 
robcash3 robcash2-random(robcash2);
                                        
GivePlayerCash(ID, -robcash3);
                                        
GivePlayerCash(playeridrobcash3);
                                        new 
string[256];
                                        
GetPlayerName(playeridpnamesizeof(pname));
                                        
format(stringsizeof(string), "You have robbed $%i from %s (%i)."robcash3onameID);
                                        
SendClientMessage(playeridLIGHTGREENstring);
                                        
format(stringsizeof(string), "%s (%i) has robbed $%i from you."pnameplayeridrobcash3);
                                        
SendClientMessage(IDREDstring);
                                        
format(stringsizeof(string), "~w~Robbed $%i from %s."robcash3oname);
                                        
GameTextForPlayer(playeridstring50004);
                                        
format(stringsizeof(string), "~w~%s has robbed $%i from you."pnamerobcash3);
                                        
GameTextForPlayer(IDstring50004);
                                    }
                                    else
                                    {
                                        
SetPlayerHealth(playerid, -69);
                                        new 
string[256];
                                        
GetPlayerName(playeridpnamesizeof(pname));
                                        
format(stringsizeof(string), "Your hand has stuck to %s (%i)'s pocket. "onameID);
                                        
SendClientMessage(playeridREDstring);
                                        
SendClientMessage(playeridRED"He noticed it and ripped your arms off.");
                                        
format(stringsizeof(string), "%s (%i)'s hand has stuck to your pocket while trying to rob you."pnameplayerid);
                                        
SendClientMessage(IDREDstring);
                                        
SendClientMessage(IDRED"You noticed it and ripped his arms off.");
                                        
format(stringsizeof(string), "*** %s (%i) has bled to death."pnameplayerid);
                                        
SendClientMessageToAll(0x880000FFstring);
                                        
format(stringsizeof(string), "~w~%s has ripped your arms off."onameID);
                                        
GameTextForPlayer(playeridstring50004);
                                        
format(stringsizeof(string), "~w~Ripped %s's arms off."onameID);
                                        
GameTextForPlayer(IDstring50004);
                                    }
                                    
robtime[playerid] = 0;
                                    
SetTimerEx("robtimer"ROB_TIMEfalse"i"playerid);
                                }
                                else
                                {
                                    new 
string[256];
                                    
format(stringsizeof(string), "%s (%i) has no money to rob!"onameID);
                                    
SendClientMessage(playeridREDstring);
                                }
                            }
                            else
                            {
                                new 
string[256];
                                
format(stringsizeof(string), "%s (%i) has to be in the same vehicle as you to be able to rob!"onameID);
                                
SendClientMessage(playeridREDstring);
                            }
                        }
                        else
                        {
                            new 
string[256];
                            
format(stringsizeof(string), "%s (%i) is not close enough to rob."onameID);
                            
SendClientMessage(playeridREDstring);
                        }
                    }
                    else
                    {
                        
SendClientMessage(playeridRED"That player is not connected!");
                    }
                }
                else
                {
                    
SendClientMessage(playeridRED"You cannot rob yourself!");
                }
            }
            else
            {
                
SendClientMessage(playeridRED"Please wait before robbing someone again.");
            }
        }
        return 
1;

Reply
#6

Bump ! I also need to put a max limit on my rob!
Reply
#7

Quote:
Originally Posted by Swisher
Посмотреть сообщение
Bump ! I also need to put a max limit on my rob!
why -rep was removed ?

OT: just dump 1 year thread for no reason!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)