[Ajuda] Veiculo VIP nao Salva
#1

Tipo: Toda vez que entra nele e voce nao compra nao consegue sai nem pelo /sair
Toda vez que compra tenta usar os comando do /v exemplo /veiculo estacionar aparece que nao e seu veiculo
Toda vez eu voce entra nele aparece que Bem Vindo a bordo de seu Carro

PHP код:
    if(strcmp(cmd,"/veiculo",true)==|| strcmp(cmd,"/vh",true)==0)
    {
        new 
vehid GetPlayerVehicleID(playerid);
        
GetPlayerName(playerid,playername,sizeof(playername));
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playerid,COLOR_WHITE," USE: /veiculo ajuda para ver os comandos de seu veнculo VIP");
            return 
1;
        }
        if(
strcmp(tmp"ajuda"true) == 0)
        {
            if(
IsPlayerConnected(playerid))
            {
                if(
PlayerInfo[playerid][pCarKey] != || PlayerInfo[playerid][pCarKey2] != 0)
                {
                    
SendClientMessage(playeridCOLOR_GRAD2,"** (/v)eiculo comprar - para comprar o Veiculo");
                    
SendClientMessage(playeridCOLOR_GRAD2,"** (/v)eiculo vender - para vender o Veiculo");
                    
SendClientMessage(playeridCOLOR_GRAD2,"** (/v)eiculo ajuda - para ver os comandos dos Veiculo");
                    
SendClientMessage(playeridCOLOR_GRAD2,"** (/v)eiculo trancar - para trancar ou abrir o Veiculo");
                    
SendClientMessage(playeridCOLOR_GRAD2,"** (/v)eiculo cor - para mudar a cor do Veiculo");
                    
SendClientMessage(playeridCOLOR_GRAD2,"** (/v)eiculo estacionar - para estacionar o Veiculo");
                    
SendClientMessage(playeridCOLOR_GRAD2,"** (/v)eiculo modelo - para mudar o modelo do Veiculo");
                    
SendClientMessage(playeridCOLOR_GRAD2,"** /retirargrana - para retirar a grana do seu carro");
                    
SendClientMessage(playeridCOLOR_LIGHTBLUE,"** Vocк precisa estar no seu carro VIP para usar esses comandos.");
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playerid,COLOR_GRAD2," Vocк nгo tem um Veiculo VIP! ");
                    return 
1;
                }
            }
            return 
1;
        }
        if(
strcmp(tmp"comprar"true) == 0)
        {
            if(
IsPlayerConnected(playerid))
            {
                if(
PlayerInfo[playerid][pVIP] >= && PlayerInfo[playerid][pSocio] >= 1)
                {
                    
SendClientMessage(playeridCOLOR_GREY"Vocк nгo й um jogador VIP/Socio");
                    return 
1;
                   }
                for(new 
0sizeof(CarInfo); i++)
                {
                    if(
CarInfo[i][ownedvehicle] == vehid)
                    {
                        if(
PlayerInfo[playerid][pCarKey] != && PlayerInfo[playerid][pVIP] < && PlayerInfo[playerid][pSocio] < 1)
                        {
                            
SendClientMessage(playeridCOLOR_GREY" Sу pode ter 1 carro vip !");
                            return 
1;
                        }
                        if(
PlayerInfo[playerid][pCarKey2] != && PlayerInfo[playerid][pSocio] < 1)
                        {
                            
SendClientMessage(playeridCOLOR_GREY" Sу pode ter 2 carros vip's !");
                            return 
1;
                        }
                        if(
CarInfo[i][cOwned]==1)
                        {
                            
SendClientMessage(playeridCOLOR_GREY"Este carro VIP/Socio jб tem dono");
                            return 
1;
                        }
                        if(
PlayerInfo[playerid][pCarKey] == 0)
                        {
                            if(
GetPlayerMoney(playerid) >= CarInfo[i][cValue])
                            {
                                
PlayerInfo[playerid][pCarKey] = i+totalveiculosc;
                                
PlayerInfo[playerid][pVeiculo] = i;
                                
CarInfo[i][cOwned] = 1;
                                
CarOffered[playerid]=0;
                                
GetPlayerName(playeridsendernamesizeof(sendername));
                                
strmid(CarInfo[i][cOwner], sendername0strlen(sendername), 999);
                                
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
                                
GameTextForPlayer(playerid"~w~Parabens~n~Voce comprou esse Carro VIP!"50003);
                                
PlayerPlaySound(playerid11470.00.00.0);
                                
SendClientMessage(playeridCOLOR_GRAD2"parabens pela sua compra !");
                                
SendClientMessage(playeridCOLOR_GRAD2"USE: /veiculo ajuda para ver os comandos");
                                
TogglePlayerControllable(playerid1);
                                
SaveCars();
                            }
                            else
                            {
                                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo tem dinheiro para isso!");
                            }
                            return 
1;
                        }
                         if(
PlayerInfo[playerid][pCarKey2] == 0)
                        {
                            if(
PlayerInfo[playerid][pSocio] < 1)
                            {
                                
SendClientMessage(playeridCOLOR_GREY"Apenas Sуcios podem ter dois carros vips.");
                                return 
1;
                            }
                            if(
GetPlayerMoney(playerid) >= CarInfo[i][cValue])
                            {
                                
PlayerInfo[playerid][pCarKey2] = i+totalveiculosc;
                                
PlayerInfo[playerid][pVeiculo2] = i;
                                
CarInfo[i][cOwned] = 1;
                                
CarOffered[playerid]=0;
                                
GetPlayerName(playeridsendernamesizeof(sendername));
                                
strmid(CarInfo[i][cOwner], sendername0strlen(sendername), 999);
                                
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
                                
GameTextForPlayer(playerid"~w~Parabens~n~Voce comprou esse Carro Socio!"50003);
                                
PlayerPlaySound(playerid11470.00.00.0);
                                
SendClientMessage(playeridCOLOR_GRAD2"parabens pela sua compra !");
                                
SendClientMessage(playeridCOLOR_GRAD2"USE: /veiculo ajuda para ver os comandos");
                                
TogglePlayerControllable(playerid1);
                                
SaveCars();
                            }
                            else
                            {
                                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo tem dinheiro para isso!");
                            }
                            return 
1;
                        }
                    }
                }
            }
            return 
1;
        }
        if(
strcmp(tmp"vender"true) == 0)
        {
            if(
IsPlayerConnected(playerid))
            {
                
GetPlayerName(playeridplayernamesizeof(playername));
                if(
PlayerInfo[playerid][pCarKey] == && PlayerInfo[playerid][pCarKey2] == 0)
                {
                    
SendClientMessage(playeridCOLOR_GREY"Vocк nгo tem um Carro VIP.");
                    return 
1;
                }
                if(
PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid)
                {
                    
SendClientMessage(playeridCOLOR_GREY"Esse nгo й seu Carro VIP.");
                    return 
1;
                }
                if(
PlayerInfo[playerid][pCarKey] != && strcmp(playernameCarInfo[PlayerInfo[playerid][pVeiculo]][cOwner], true) == 0)
                {
                    new 
rand;
                    new 
car PlayerInfo[playerid][pVeiculo];
                    
CarInfo[car][cOwned] = 0;
                    
CarInfo[car][cModel] = 560;
                    
CarInfo[car][cColorOne] = 0;
                    
CarInfo[car][cColorTwo] = 0;
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
strmid(CarInfo[car][cOwner], "Dealership"0strlen("Dealership"), 999);
                    
GivePlayerMoney(playerid,CarInfo[car][cValue]);
                    
PlayerPlaySound(playerid10520.00.00.0);
                    
format(stringsizeof(string), "~w~Carro Vip Vendido Por: ~n~~g~$%d"CarInfo[car][cValue]);
                    
GameTextForPlayer(playeridstring100003);
                    
RemovePlayerFromVehicleEx(playerid);
                    
TogglePlayerControllable(playerid1);
                    
PlayerInfo[playerid][pCarKey] = 0;
                    
PlayerInfo[playerid][pVeiculo] = 0;
                    
rand random(sizeof(gRandomCarsSpawns));
                    
CarInfo[car][cLocationx] = gRandomCarsSpawns[rand][0];
                    
CarInfo[car][cLocationy] = gRandomCarsSpawns[rand][1];
                    
CarInfo[car][cLocationz] = gRandomCarsSpawns[rand][2];
                    
CarInfo[car][cAngle] = gRandomCarsSpawns[rand][3];
                    
SaveCars();
                    return 
1;
                }
                else if(
PlayerInfo[playerid][pCarKey2] != && strcmp(playernameCarInfo[PlayerInfo[playerid][pVeiculo2]][cOwner], true) == 0)
                {
                    new 
rand;
                    new 
car PlayerInfo[playerid][pVeiculo2];
                    
CarInfo[car][cOwned] = 0;
                    
CarInfo[car][cModel] = 560;
                    
CarInfo[car][cColorOne] = 0;
                    
CarInfo[car][cColorTwo] = 0;
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
strmid(CarInfo[car][cOwner], "Dealership"0strlen("Dealership"), 999);
                    
GivePlayerMoney(playerid,CarInfo[car][cValue]);
                    
PlayerPlaySound(playerid10520.00.00.0);
                    
format(stringsizeof(string), "~w~Carro Vip Vendido Por: ~n~~g~$%d"CarInfo[car][cValue]);
                    
GameTextForPlayer(playeridstring100003);
                    
RemovePlayerFromVehicleEx(playerid);
                    
TogglePlayerControllable(playerid1);
                    
PlayerInfo[playerid][pCarKey2] = 0;
                    
PlayerInfo[playerid][pVeiculo2] = 0;
                    
rand random(sizeof(gRandomCarsSpawns));
                    
CarInfo[car][cLocationx] = gRandomCarsSpawns[rand][0];
                    
CarInfo[car][cLocationy] = gRandomCarsSpawns[rand][1];
                    
CarInfo[car][cLocationz] = gRandomCarsSpawns[rand][2];
                    
CarInfo[car][cAngle] = gRandomCarsSpawns[rand][3];
                    
SaveCars();
                    return 
1;
                }
            }
            return 
1;
        }
        if(
strcmp(tmp"trancar"true) == 0)
        {
            if(
PlayerInfo[playerid][pCarKey] == && PlayerInfo[playerid][pCarKey2] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"Vocк nгo tem um Carro VIP.");
                return 
1;
            }
            if(
PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid)
            {
                
SendClientMessage(playeridCOLOR_GREY"Esse nгo й seu Carro VIP.");
                return 
1;
            }
            new 
keycar;
            if(
vehid == PlayerInfo[playerid][pCarKey]) { keycar PlayerInfo[playerid][pVeiculo]; }
            else if(
vehid == PlayerInfo[playerid][pCarKey2]) { keycar PlayerInfo[playerid][pVeiculo2]; }
            if(
IsPlayerConnected(playerid))
            {
                if(
CarInfo[keycar][cLock] == 1)
                {
                for(new 
0MAX_PLAYERSi++)
                {
                    if(
IsPlayerConnected(i)) SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,0);
                }
                
format(stringsizeof(string), "~w~Veiculo VIP~n~~g~Aberto");
                
PlayerPlaySound(playerid11450.00.00.0);
                
GameTextForPlayer(playeridstring100003);
                
CarInfo[keycar][cLock] = 0;
                return 
1;
                }
                else
                {
                for(new 
0MAX_PLAYERSi++)
                {
                    if(
IsPlayerConnected(i)) SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,1);
                }
                
format(stringsizeof(string), "~w~Veiculo VIP~n~~r~Trancado");
                
PlayerPlaySound(playerid11450.00.00.0);
                
GameTextForPlayer(playeridstring100003);
                
CarInfo[keycar][cLock] = 1;
                return 
1;
                }
            }
            return 
1;
        }
        if(
strcmp(tmp"estacionar"true) == 0)
        {
            if(
PlayerInfo[playerid][pCarKey] == && PlayerInfo[playerid][pCarKey2] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"Vocк nгo tem um Carro VIP.");
                return 
1;
            }
            if(
PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid)
            {
                
SendClientMessage(playeridCOLOR_GREY"Esse nгo й seu Carro VIP.");
                return 
1;
            }
            new 
Float:x,Float:y,Float:z;
            new 
Float:a;
            new 
carid;
            new 
getcarid;
            new 
Veiculo;
               if(
vehid == PlayerInfo[playerid][pCarKey]) { carid PlayerInfo[playerid][pCarKey]; Veiculo PlayerInfo[playerid][pVeiculo]; }
            else if(
vehid == PlayerInfo[playerid][pCarKey2]) { carid PlayerInfo[playerid][pCarKey2]; Veiculo PlayerInfo[playerid][pVeiculo2]; }
            if(
IsPlayerInVehicle(playerid,carid) && CarInfo[Veiculo][cOwned] == 1)
            {
                
getcarid GetPlayerVehicleID(playerid);
                
GetPlayerName(playeridplayernamesizeof(playername));
                
GetVehiclePos(caridxyz);
                
GetVehicleZAngle(carida);
                   if(
getcarid == carid)
                {
                    
CarInfo[Veiculo][cLocationx] = x;
                    
CarInfo[Veiculo][cLocationy] = y;
                    
CarInfo[Veiculo][cLocationz] = z;
                    
CarInfo[Veiculo][cAngle] = a;
                    
format(stringsizeof(string), "~n~ Veiculo Estacionado Aqui! ~n~");
                    
GameTextForPlayer(playerid"Veiculo Estacionado!~n~Ele vai nascer aqui!."100003);
                    
DestroyVehicle(carid);
                    new 
carid2 CreateVehicle(CarInfo[Veiculo][cModel],CarInfo[Veiculo][cLocationx],CarInfo[Veiculo][cLocationy],CarInfo[Veiculo][cLocationz]+1.0,CarInfo[Veiculo][cAngle],CarInfo[Veiculo][cColorOne],CarInfo[Veiculo][cColorTwo],60000);
                    
TogglePlayerControllable(playerid1);
                    
SaveCars();
                    
SetVehicleToRespawn(carid2);
                    return 
1;
                  }
                return 
1;
            }
            return 
1;
        }
        if(
strcmp(tmp"modelo"true) == 0)
        {
            if(
PlayerInfo[playerid][pCarKey] == && PlayerInfo[playerid][pCarKey2] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"Vocк nгo tem um Carro VIP.");
                return 
1;
            }
            if(
PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid)
            {
                
SendClientMessage(playeridCOLOR_GREY"Esse nгo й seu Carro VIP.");
                return 
1;
            }
            new 
modelo;
            new 
carid;
            new 
Veiculo;
            if(
vehid == PlayerInfo[playerid][pCarKey]) { carid PlayerInfo[playerid][pCarKey]; Veiculo PlayerInfo[playerid][pVeiculo]; }
            else if(
vehid == PlayerInfo[playerid][pCarKey2]) { carid PlayerInfo[playerid][pCarKey2]; Veiculo PlayerInfo[playerid][pVeiculo2]; }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /veiculo modelo [modelo(400 б 611)]");
                return 
1;
            }
            
modelo strval(tmp);
            if(
modelo 400 || modelo 611) { SendClientMessage(playeridCOLOR_GREY" Nossos Modelos Estгo Entre 400 e 611!"); return 1; }
            if(
modelo == 592 || modelo == 577 || modelo == 553 || modelo == 520 || modelo == 525 || modelo == 547 || modelo == 435
            
|| modelo == 441 || modelo == 449 || modelo == 450 || modelo == 460 || modelo == 464 || modelo == 465 || modelo == 501
            
|| modelo == 537 || modelo == 538 || modelo == 564 || modelo == 569 || modelo == 570 || modelo == 584 || modelo == 590
            
|| modelo == 591 || modelo == 594 || modelo == 606 || modelo == 607 || modelo == 608 || modelo == 610 || modelo == 611
            
|| modelo == 596 || modelo == 599 || modelo == 597 || modelo == 598 || modelo == 427 || modelo == 528 || modelo == 544
            
|| modelo == 407 || modelo == 455 || modelo == 502 || modelo == 503 || modelo == 494 || modelo == 582 || modelo == 470
            
|| modelo == 495 || modelo == 601 || modelo == 548 || modelo == 417 || modelo == 497 || modelo == 563 || modelo == 447
            
|| modelo == 469 || modelo == 488 || modelo == 557 || modelo == 556 || modelo == 444 || modelo == 573 || modelo == 406
            
|| modelo == 590 || modelo == 569 || modelo == 537 || modelo == 538 || modelo == 570 || modelo == 449 || modelo == 472
            
|| modelo == 473 || modelo == 493 || modelo == 595 || modelo == 484 || modelo == 430 || modelo == 453 || modelo == 452
            
|| modelo == 446 || modelo == 454 || modelo == 432 || modelo == 425 || modelo == 571 || modelo == 490 || modelo == 523
             
|| modelo == 408 || modelo == 414 || modelo == 416 || modelo == 420 || modelo == 423 || modelo == 428
            
|| modelo == 431 || modelo == 433 || modelo == 437 || modelo == 438 || modelo == 443 || modelo == 456 || modelo == 476
            
|| modelo == 486 || modelo == 490 || modelo == 498 || modelo == 499 || modelo == 511 || modelo == 512 || modelo == 513
            
|| modelo == 514 || modelo == 515 || modelo == 519 || modelo == 523 || modelo == 524 || modelo == 530 || modelo == 531
            
|| modelo == 532 || modelo == 539 || modelo == 568 || modelo == 572 || modelo == 574 || modelo == 578 || modelo == 483
            
|| modelo == 583 || modelo == 588 || modelo == 593 || modelo == 609)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"Este Modelo й Proibido!");
                return 
1;
            }
               if(
IsPlayerInVehicle(playerid,carid) && CarInfo[Veiculo][cOwned] == 1)
            {
                
CarInfo[Veiculo][cModel] = modelo;
                
GameTextForPlayer(playerid"Modelo do seu Carro VIP Mudado! -R$5000."100003);
                
DestroyVehicle(carid);
                
CreateVehicle(CarInfo[Veiculo][cModel],CarInfo[Veiculo][cLocationx],CarInfo[Veiculo][cLocationy],CarInfo[Veiculo][cLocationz]+1.0,CarInfo[Veiculo][cAngle],CarInfo[Veiculo][cColorOne],CarInfo[Veiculo][cColorTwo],60000);
                
TogglePlayerControllable(playerid1);
                
GivePlayerMoney(playerid,-5000);
                
SBizzInfo[8][sbTill] += 5000;
                
ExtortionSBiz(85000);
                
SaveCars();
                return 
1;
            }
            return 
1;
        }
        if(
strcmp(tmp"cor"true) == 0)
        {
            if(
PlayerInfo[playerid][pCarKey] == && PlayerInfo[playerid][pCarKey2] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"Vocк nгo tem um Carro VIP.");
                return 
1;
            }
            if(
PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid)
            {
                
SendClientMessage(playeridCOLOR_GREY"Esse nгo й seu Carro VIP.");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_YELLOW"USE: /veiculo cor [cor 1] [cor 2]");
                
SendClientMessage(playeridCOLOR_YELLOW"Cores = Entre 0 e 126!.");
                return 
1;
            }
            new 
carid;
            new 
Veiculo;
            if(
vehid == PlayerInfo[playerid][pCarKey]) { carid PlayerInfo[playerid][pCarKey]; Veiculo PlayerInfo[playerid][pVeiculo]; }
            else if(
vehid == PlayerInfo[playerid][pCarKey2]) { carid PlayerInfo[playerid][pCarKey2]; Veiculo PlayerInfo[playerid][pVeiculo2]; }
            new 
cor1;
            
cor1 strval(tmp);
            if(
cor1 || cor1 126) { SendClientMessage(playeridCOLOR_GREY"   Cores entre 0 e 126!"); return 1; }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_YELLOW"USE: /veiculo cor [cor 1] [cor 2]");
                
SendClientMessage(playeridCOLOR_YELLOW"Cores = Entre 0 e 126!.");
                return 
1;
            }
            new 
cor2;
            
cor2 strval(tmp);
            if(
cor2 || cor2 126) { SendClientMessage(playeridCOLOR_GREY"   Cores entre 0 e 126!"); return 1; }
               if(
IsPlayerInVehicle(playerid,carid) && CarInfo[Veiculo][cOwned] == 1)
            {
                
CarInfo[Veiculo][cColorOne] = cor1;
                
CarInfo[Veiculo][cColorTwo] = cor2;
                
GameTextForPlayer(playerid"Cor do seu Carro VIP Mudada! -R$2500."100003);
                
ChangeVehicleColor(carid,cor1,cor2);
                
TogglePlayerControllable(playerid1);
                
GivePlayerMoney(playerid,-2500);
                
SBizzInfo[8][sbTill] += 2500;
                
ExtortionSBiz(82500);
                
SaveCars();
                return 
1;
            }
            return 
1;
          }
          return 
0;
     } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)