[Ayuda] /aceptar car
#1

Buenas, tengo un problema al aceptar un coche cuando uso al /vendercoche lo vende perfectamente a la persona, pero al aceptarlo dice que nadie le a ofrecido un coche.
A que se deve esto?

Muchas Gracias!


Код:
if(strcmp(cmd,"/vendercoche",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
          if(PlayerInfo[playerid][pLeader] != 12|| PlayerInfo[playerid][pMember] != 12)
            {

            if(!IsPlayerInAnyVehicle(playerid))
            {
                SendClientMessage(playerid,COLOR_GREY,"   No estas en un coche !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USO: /vendercoche [playerid/PartOfName] [precio]");
                return 1;
            }
            //giveplayerid = strval(tmp);
            giveplayerid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USO: /vendercoche [playerid/PartOfName] [precio]");
                return 1;
            }
            new money = strval(tmp);
            if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, "   El precio debe situarse entre 1 y 99999$ !"); return 1; }
            if (IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if (ProxDetectorS(8.0, playerid, giveplayerid))
                    {
                        if(giveplayerid == playerid)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "   No puedes vendertelo a ti mismo!");
                            return 1;
                        }
                        if(CarCalls[giveplayerid] > 0)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "   El jugador ya compro un coche, tiene que usar /llamarcoche primero !");
                            return 1;
                        }
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* Ofreciste a %s comprar un coche por $%d .", 			giveplayer, money);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* Seсor: %s Te Ofreciу Su Coche Por: $%d (escribe 			/aceptar car para comprarlo).", sendername, money);
			SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                        CarOffer[giveplayerid] = playerid;
                        CarPrice[giveplayerid] = money;
                        CarID[giveplayerid] = GetPlayerVehicleID(playerid);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   El jugador no esta cerca tuyo !");
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   ID o nombre invalido !");
                return 1;
            }
        }
        }
        return 1;
    }
Код:
else if(strcmp(x_job,"car",true) == 0)
   {
       if(OwnableCarOffer[playerid] < 999)
       {
           if(OwnableCarID[playerid] == 0) { return 1; }
           if(OwnableCarPrice[playerid] == 0 || OwnableCarPrice[playerid] > 5500000) { return 1; }

           if(OwnableCarID[playerid] == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey]) { }
           else if(OwnableCarID[playerid] == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2]) { }
           else { SendClientMessage(playerid, COLOR_GREY, "  La oferta Expiro"); return 1; }

           if(GetPlayerMoney(playerid) >= OwnableCarPrice[playerid])
           {
      if(IsPlayerConnected(OwnableCarOffer[playerid]))
      {
          GetPlayerName(OwnableCarOffer[playerid], giveplayer, sizeof(giveplayer));
          GetPlayerName(playerid, sendername, sizeof(sendername));
          if(PlayerInfo[playerid][pPcarkey] == 999)
       {
        if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey])
        {
         PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey];
            PlayerInfo[OwnableCarOffer[playerid]][pPcarkey] = 999;
        }
        else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2])
        {
         PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2];
            PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2] = 999;
        }
         else
        {
            SendClientMessage(playerid, COLOR_GREY, "  Tienes que estar en el vehiculo para poder venderlo !");
         return 1;
        }
        format(string, sizeof(string), "* Usted acaba de comprar un vehiculo por $%d A %s.",OwnableCarPrice[playerid],giveplayer);
        SendClientMessage(playerid, COLOR_BLUE, string);
        format(string, sizeof(string), "* %s Ha comprado el vehiculo por $%d.",sendername,OwnableCarPrice[playerid]);
        SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
           RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
           SafeGivePlayerMoney(playerid, - OwnableCarPrice[playerid]);
           SafeGivePlayerMoney(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
           strmid(CarInfo[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
           format(string, sizeof(string), "ESET-NOD32: %s compra a %s un coche por %d", sendername, OwnableCarOffer[playerid],OwnableCarPrice[playerid]);
        ESETPropertyLog(string);
       }
       else if(PlayerInfo[playerid][pPcarkey2] == 999)
       {
           if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey])
        {
         PlayerInfo[playerid][pPcarkey2] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey];
            PlayerInfo[OwnableCarOffer[playerid]][pPcarkey] = 999;
        }
        else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2])
        {
         PlayerInfo[playerid][pPcarkey2] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2];
            PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2] = 999;
        }
        else
        {
             SendClientMessage(playerid, COLOR_GREY, "  Tienes que estar en el vehiculo para poder venderlo !");
         return 1;
        }
        format(string, sizeof(string), "* Usted acaba de comprar un vehiculo por $%d A %s.",OwnableCarPrice[playerid],giveplayer);
        SendClientMessage(playerid, COLOR_WHITE, string);
        format(string, sizeof(string), "* %s Ha comprado el vehiculo por $%d.",sendername,OwnableCarPrice[playerid]);
        SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
           RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
           SafeGivePlayerMoney(playerid, - OwnableCarPrice[playerid]);
           SafeGivePlayerMoney(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
           strmid(CarInfo[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
          }
          DateProp(playerid);
       DateProp(OwnableCarOffer[playerid]);
       OnPropUpdate();
       PlayerUpdate(playerid);
       PlayerUpdate(OwnableCarOffer[playerid]);
          OwnableCarOffer[playerid] = 999;
       OwnableCarID[playerid] = 0;
       OwnableCarPrice[playerid] = 0;

       return 1;
      }
      else
      {
          SendClientMessage(playerid, COLOR_GREY, "   Car seller is Offline !");
             return 1;
      }
           }
       }
       else
       {
           SendClientMessage(playerid, COLOR_GREY, "  Nadie te ah ofrecido ningun vehiculo!");
           return 1;
       }
   }
Reply


Messages In This Thread
[Ayuda] /aceptar car - by Sergikoh - 11.08.2011, 18:49
Respuesta: [Ayuda] /aceptar car - by M1tux3r - 11.08.2011, 19:17
Respuesta: [Ayuda] /aceptar car - by ermakiloko - 11.08.2011, 19:46
Respuesta: [Ayuda] /aceptar car - by Sergikoh - 11.08.2011, 23:05
Respuesta: [Ayuda] /aceptar car - by M1tux3r - 11.08.2011, 23:42

Forum Jump:


Users browsing this thread: 1 Guest(s)