Help plz )+++REP)
#1

can you guys help me in making a /mb command so players can see hints that is given

here is the code
PHP код:
public ChangeStage()
{
        switch( 
gCurrStage )
        {
                case 
STAGE_INVALID:
                {
                        if(
moneybag == 0)
                        {
                        new 
_rand random(sizeof(g_MoneyBagSpawns)), _string[128];
                        
gMoneyBag CreatePickup(PICKUP_MODEL_ID2g_MoneyBagSpawns[_rand][0], g_MoneyBagSpawns[_rand][1], g_MoneyBagSpawns[_rand][2], 0);
                        
gCurrPrize = ( random( (PRIZE_UPPER_LIMIT PRIZE_LOWER_LIMIT) ) + PRIZE_LOWER_LIMIT );
                        for(new 
03i++)
                        {
                                
g_fCurrPos[i] = g_MoneyBagSpawns[_rand][i];
                        }
                        
format(_stringsizeof(_string), "{4AE8E8}INFO: {FFFFFF}A moneybag (worth $%s) has been spawned!"AddCharComma(gCurrPrize));
                        
SendClientMessageToAll(-1_string);
                        
gCurrStage STAGE_SPAWNED ;
                        
clue1 =1;
                        }
                        else
                        {
                         
//////////no mb
                        
}
                }
                case 
STAGE_SPAWNED:
                {
                        if(
moneybag == 0)
                        {
                        new 
_string[128], _loc[30];
                        
Get2DZone(g_fCurrPos[0], g_fCurrPos[1], _locsizeof(_loc));
                        
format(_stringsizeof(_string), "{4AE8E8}INFO: {FFFFFF}The money bag is in '%s'."_loc);
                        
SendClientMessageToAll(-1_string);
                        
gCurrStage STAGE_REVEAL_LOC ;
                        
clue2 =1;
                        }
                        else
                        {
                         
//////////no mb
                        
}
                }
                case 
STAGE_REVEAL_LOC:
                {
                        if(
moneybag == 0)
                        {
                        new 
cPlayer GetClosestTo(g_fCurrPos[0], g_fCurrPos[1], g_fCurrPos[2]),
                                
_string[128];
                        if( 
cPlayer != INVALID_PLAYER_ID )
                        {
                                new 
_nameMAX_PLAYER_NAME ];
                                
GetPlayerName(cPlayer_nameMAX_PLAYER_NAME);
                                
format(_stringsizeof(_string), "{4AE8E8}INFO: {4AE8E8}%s (%d){FFFFFF} is closest to the money bag!"_namecPlayer);
                        }
                        else 
format(_stringsizeof(_string), "{4AE8E8}INFO: {FFFFFF}There is no one close to the money bag, yet.");
                        
SendClientMessageToAll(-1_string);
                        
gCurrStage STAGE_REVEAL_CLP;
                        
clue3=1;
                        }
                        else
                        {
                         
//////////no mb
                        
}
                }
                case 
STAGE_REVEAL_CLP:
                {
                        if(
moneybag == 0)
                        {
                        new 
clPlayer GetClosestTo(g_fCurrPos[0], g_fCurrPos[1], g_fCurrPos[2]),
                                
FloatfDist,
                                
_string[128];
                        if( 
clPlayer != INVALID_PLAYER_ID)
                        {
                                new 
_name[MAX_PLAYER_NAME];
                                
fDist GetPlayerDistanceFromPoint(clPlayerg_fCurrPos[0], g_fCurrPos[1], g_fCurrPos[2]);
                                
GetPlayerName(clPlayer_nameMAX_PLAYER_NAME);
                                
format(_stringsizeof(_string), "{4AE8E8}INFO: {FFFFFF}The distance of the closest player - {4AE8E8}%s (%d) - {FFFFFF}from the money bag is %d metres."_nameclPlayerfloatround(fDist));
                                
clue4=1;
                        }
                        else
                                
format(_stringsizeof(_string), "{4AE8E8}INFO: {FFFFFF}There is no one yet close the the money bag!");
                        
SendClientMessageToAll(-1_string);
                        
gCurrStage STAGE_REVEAL_DIS;
                        }
                        else
                        {
                         
//////////no mb
                        
}
                }
                case 
STAGE_REVEAL_DIS:
                {
                        if(
moneybag == 0)
                        {
                        
SendClientMessageToAll(-1"{4AE8E8}INFO: {FFFFFF}No one could find the money bag, and it has been reset!");
                        
DestroyPickup(gMoneyBag);
                        
gMoneyBag = -1;
                        
gCurrStage STAGE_INVALID;
                        }
                        else
                        {
                         
//////////no mb
                        
}
                }
        }
        return 
1;

Reply
#2

for zcmd

PHP код:
CMD:mb(playeridparams[])
{
    if(
moneybag == 0)
    {
            new 
_string[128], _loc[30];
            
Get2DZone(g_fCurrPos[0], g_fCurrPos[1], _locsizeof(_loc));
            
format(_stringsizeof(_string), "{4AE8E8}INFO: {FFFFFF}The money bag is in '%s'."_loc);
            
SendClientMessage(playerid, -1_string);
    }
    else
    {
         
SendClientMessage(playerid, -1"There is no money bag created.");
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)