SA-MP Forums Archive
Problem. - 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: Problem. (/showthread.php?tid=511688)



Problem. - Cineva - 06.05.2014

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);
                        }
                    }
                }
            }
        }
   } 



Re: Problem. - Bingo - 06.05.2014

Sorry, Can't understand.

You get money when?
&
When you aren't?


Re: Problem. - Cineva - 06.05.2014

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


Re: Problem. - Syncro - 07.05.2014

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!