Problem.
#1

Hi, I have a problem when I do not get into checkpoint give money. I did give me money depending on trailer Sorry for my bad english
PHP код:
if(CP[playerid] == truck1 || truck2 || truck3 || truck4 || truck5// finish job
    
{
        new 
string[128], random_money 25000+random(10000);
        {
            if(
GetVehicleTrailer(GetPlayerVehicleID(playerid))) SendClientMessage(playerid0xFFFFFFAA"You are currently towing a trailer.");
            {
                if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
                if(!
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))){ DisablePlayerCheckpoint(playerid); return 1; }
                {
                    switch ( 
GetVehicleTrailer GetPlayerVehicleID playerid ) ) )
                    {
                        case 
450:
                        {
                            
random_money 25000 random 10000 );
                            
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] +  random_money;
                            
format(string,sizeof(string),"[+]Congratulations you reached the destination. You got $%s "FormatMoney(random_money));
                            
SendClientMessage(playeridCOLOR_GREENstring);
                        }
                        case 
584:
                        {
                            
random_money 35000 random 40000 );
                            
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] +  random_money;
                            
format(string,sizeof(string),"[+]Congratulations you reached the destination. You got $%s "FormatMoney(random_money));
                            
SendClientMessage(playeridCOLOR_GREENstring);
                        }
                    }
                }
            }
        }
   } 
Reply
#2

Sorry, Can't understand.

You get money when?
&
When you aren't?
Reply
#3

If the truck's attached trailer with id (435)https://sampwiki.blast.hk/wroot/images2/...ehicle_435.jpg receive a sum of money and if the trailer is 450 to receive another amount
Reply
#4

Quote:
Originally Posted by Cineva
Посмотреть сообщение
If the truck's attached trailer with id (435)https://sampwiki.blast.hk/wroot/images2/...ehicle_435.jpg receive a sum of money and if the trailer is 450 to receive another amount
In the switch you have different IDs! You have 584 and 450, not 435 and 450!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)