Cars Spawnning
#1

This is the code:
PHP код:
      new Str[256];
        new 
StrN[128];
        new 
vehicleid GetPlayerVehicleID(playerid);
        new 
Float:xFloat:yFloat:z;
        new 
Float:a;
        
GetPlayerName(playeridNamesizeof(Name));
        
format(Filesizeof(File), CarsName);
    if(
response && response)
        {
                                if(
listitem == 0)
                                {
                   
GetPlayerName(playeridNamesizeof(Name));
                       
format(Filesizeof(File), CarsName);
                                   if(!
dini_Exists(File))
                                   {
                                          new 
gpCar;
                                          
gpCar GetPlayerVehicleID(playerid);
                                      if(
GetPlayerMoney(playerid) < 125000) return SendClientMessage(playerid0xFF0000FF"You Dont Have Enough Money!");
                                      
GetPlayerPos(playeridxyz);
                                      
GetPlayerFacingAngle(playerida);
                                      
GivePlayerMoney(playerid, -1250000);
                                      
pCar[playerid] = CreateVehicle(400xyza00, -1);
                                      
PutPlayerInVehicle(playerid, (pCar[playerid]), 0);
                                      
PlayerPlaySound(playerid10570.00.00.0);
                                      
SendClientMessage(playerid0xFFFF00FF"Vehicle Bought ! ! !");
                                      
format(Strsizeof(Str), "400"GetVehicleModel(gpCar));
                                      
format(StrNsizeof(StrN), "%s"Name);
                                      
ChangeVehicleColor(vehicleid00);
                                      new 
On[128];
                                      
format(Onsizeof(On), "Owner: %s"Name);
                                          
TOwner[playerid] = Create3DTextLabel(On0x00FF00FFxyz4501);
                                      
Attach3DTextLabelToVehicle(TOwner[playerid], pCar[playerid], 0.00.01.0);
                                      
dini_Create(File);
                                      
dini_Set(File"Owner"StrN);
                                      
dini_Set(File"CarID"Str);
                                   }
                                   else
                                   {
                          if(
fexist(File))
                          {
                                             
PlayerPlaySound(playerid10580.00.00.0);
                         
SendClientMessage(playerid0xFF0000FF"You Allready Have A Car!");
                                      }
                                   }
                                } 
And the end of the dialog:
PHP код:
return 1;

When i enter the checkpoint the dialog apear and all thing is going right but when i click on any item from the list it doesn't do anything and even if i haven't the money needed it does't send the client message.
Please Help !!!
Reply
#2

Did you set the right dialog ID?
Why this?
Код:
if(response && response)
When you can just set
Код:
if(response)
And new Str[256], please don't do it. You are only storing vehicle's name in that string, which must not be that large.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)