Adding buyable cars
#2

Quote:
Originally Posted by XYZero
Посмотреть сообщение
Hi guys, i want to ask how to add buyable cars in my server?, i used SATDM gamemode by MoNeYPiMp :P
PHP код:
public OnPlayerSpawn(playerid)
{
    
SetPlayerCheckpoint(playerid1956.2844,1342.8551,15.37463.0);
    return 
1;

PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    
ShowPlayerDialog(playeridDIALOG_CARSDIALOG_STYLE_LIST"Car Shop""Stretch\nInfernus\nBullet\nSuper GT\nHotring Racer\nElegy\nSultan\nBF Injection\nJester\nCheetah""Select""Cancel");
    return 
1;


PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_CARS)
    {
        if(
response// 
        
{
            
// 
            
switch(listitem)
            {
                case 
0:{
                if(
GetPlayerMoney(playerid) >= 245000)
            {
                
CreateVehicle(4091956.2844,1342.8551,15.3746,99.81310160); // Car 2
                
GivePlayerMoney(playerid, -1500);
            }
                if(
GetPlayerMoney(playerid) < 245000)
            {
                
SendClientMessage(playerid, -1"You Dont Have Enough Money");
            }
            }
                case 
1:{
                if(
GetPlayerMoney(playerid) >= 160000)
            {
                
CreateVehicle(4111956.2844,1342.8551,15.3746,99.81310160); // Car 2
                
GivePlayerMoney(playerid, -1500);
            }
                if(
GetPlayerMoney(playerid) < 160000)
            {
                
SendClientMessage(playerid, -1"You Dont Have Enough Money");
            }
            }
                case 
2:{
                if(
GetPlayerMoney(playerid) >= 140000)
            {
                
CreateVehicle(5411956.2844,1342.8551,15.3746,99.81310160); // Car 2
                
GivePlayerMoney(playerid, -1500);
            }
                if(
GetPlayerMoney(playerid) < 140000)
            {
                
SendClientMessage(playerid, -1"You Dont Have Enough Money");
            }
            }
            case 
3:{
                if(
GetPlayerMoney(playerid) >= 80000)
            {
                
CreateVehicle(5061956.2844,1342.8551,15.3746,99.81310160); // Car 2
                
GivePlayerMoney(playerid, -1500);
            }
                if(
GetPlayerMoney(playerid) < 80000)
            {
                
SendClientMessage(playerid, -1"You Dont Have Enough Money");
            }
            }
            case 
4:{
                if(
GetPlayerMoney(playerid) >= 120000)
            {
                
CreateVehicle(4941956.2844,1342.8551,15.3746,99.81310160); // Car 2
                
GivePlayerMoney(playerid, -1500);
            }
                if(
GetPlayerMoney(playerid) < 120000)
            {
                
SendClientMessage(playerid, -1"You Dont Have Enough Money");
            }
            }
            case 
5:{
                if(
GetPlayerMoney(playerid) >= 100000)
            {
                
CreateVehicle(5621956.2844,1342.8551,15.3746,99.81310160); // Car 2
                
GivePlayerMoney(playerid, -1500);
            }
                if(
GetPlayerMoney(playerid) < 100000)
            {
                
SendClientMessage(playerid, -1"You Dont Have Enough Money");
            }
            }
            case 
6:{
                if(
GetPlayerMoney(playerid) >= 45000)
            {
                
CreateVehicle(5601956.2844,1342.8551,15.3746,99.81310160); // Car 2
                
GivePlayerMoney(playerid, -1500);
            }
                if(
GetPlayerMoney(playerid) < 45000)
            {
                
SendClientMessage(playerid, -1"You Dont Have Enough Money");
            }
            }
            case 
7:{
                if(
GetPlayerMoney(playerid) >= 65000)
            {
                
CreateVehicle(4241956.2844,1342.8551,15.3746,99.81310160); // Car 2
                
GivePlayerMoney(playerid, -1500);
            }
                if(
GetPlayerMoney(playerid) < 65000)
            {
                
SendClientMessage(playerid, -1"You Dont Have Enough Money");
            }
            }
            case 
8:{
                if(
GetPlayerMoney(playerid) >= 60000)
            {
                
CreateVehicle(5591956.2844,1342.8551,15.3746,99.81310160); // Car 2
                
GivePlayerMoney(playerid, -1500);
            }
                if(
GetPlayerMoney(playerid) < 60000)
            {
                
SendClientMessage(playerid, -1"You Dont Have Enough Money");
            }
            }
            
            case 
9:{
                if(
GetPlayerMoney(playerid) >= 125000)
            {
                
CreateVehicle(4151956.2844,1342.8551,15.3746,99.81310160); // Car 2
                
GivePlayerMoney(playerid, -1500);
            }
                if(
GetPlayerMoney(playerid) < 125000)
            {
                
SendClientMessage(playerid, -1"You Dont Have Enough Money");
            }
            }
            
            }
        }
        return 
1// We handled a dialog, so return 1. Just like OnPlayerCommandText.
    
}
    return 
0// You MUST return 0 here! Just like OnPlayerCommandText.

+REP If I helped you
Reply


Messages In This Thread
Adding buyable cars - by XYZero - 20.03.2015, 15:52
Re: Adding buyable cars - by Fantje - 20.03.2015, 15:58
Re: Adding buyable cars - by XYZero - 20.03.2015, 16:18
Re: Adding buyable cars - by Fantje - 20.03.2015, 17:38
Re: Adding buyable cars - by SickAttack - 20.03.2015, 17:43
Re: Adding buyable cars - by XYZero - 20.03.2015, 17:47
Re: Adding buyable cars - by Bester - 20.03.2015, 18:55
Re: Adding buyable cars - by XYZero - 20.03.2015, 19:42
Re: Adding buyable cars - by XYZero - 21.03.2015, 09:44
Re: Adding buyable cars - by mirou123 - 21.03.2015, 09:49

Forum Jump:


Users browsing this thread: 2 Guest(s)