[Pedido] Model Textdraws.
#1

Boas pessoal, alguйm podia fazer um tutorial a explicar como os model's texdraws funcionam?


eu tenho este comando
pawn Код:
if(strcmp(cmd, "/comprarveiculo", true) == 0)
        {
            if(PlayerInfo[playerid][CarKey1] == 999 || PlayerInfo[playerid][CarKey2] == 999 || PlayerInfo[playerid][CarKey3] == 999 || PlayerInfo[playerid][CarKey4] == 999 || PlayerInfo[playerid][CarKey5] == 999 || PlayerInfo[playerid][CarKey6] == 999)
            {
                for(new i = 0; i < sizeof(Businesses); i++)
                {
                    if (PlayerToPoint(25.0, playerid,Businesses[i][ExitX], Businesses[i][ExitY], Businesses[i][ExitZ]))
                    {
                        if(GetPlayerVirtualWorld(playerid) == i)
                        {
                            if(Businesses[i][BizType] == 9)
                            {
                                if(PlayerToPoint(10.0, playerid,345.5447,160.1090,1014.1875))
                                {
                                    tmp = strtok(cmdtext, idx);
                                    if(!strlen(tmp))
                                    {
                                        SendClientMessage(playerid, COLOR_MECANICOS, "Comando: /comprarveiculo [ID do Modelo do Veiculo]");
                                        return 1;
                                    }
                                    new TCarModel = strval(tmp);
                                    for(new c=0;c<MAX_VEHICLES;c++)
                                    {
                                        if(DynamicCars[c][comprado] == 0)
                                        {
                                            if(DynamicCars[c][buy] == 1)
                                            {
                                                if(DynamicCars[c][CarModel] == 510)
                                                {
                                                    if(IsValidModel(TCarModel))
                                                    {
                                                        new valor2 = TCarModel-400;
                                                        new price = VehiclePrices[valor2][0];
                                                        if (PlayerInfo[playerid][VipActive] == 0 && price <= GetPlayerEuros(playerid) || PlayerInfo[playerid][VipActive] != 0 && price/2 <= GetPlayerEuros(playerid))
                                                        {
                                                            PlayerActionMessage(playerid,15.0,"entrega um cheque ao gerente do Stand, e recebe em troca as chaves de um veiculo novo.");
                                                            SendClientMessage(playerid, COLOR_WHITE, "Compraste o veiculo com sucesso.");
                                                            DynamicCars[c][CarModel] = TCarModel;
                                                            DynamicCars[c][CarColor1] = 1;
                                                            DynamicCars[c][CarColor2] = 1;
                                                            DynamicCars[c][comprado] = 1;
                                                            DynamicCars[c][buy] = 0;
                                                            DynamicCars[c][CarType] = 0;
                                                            DynamicCars[c][FactionCar] = 255;
                                                            DynamicCars[c][cPaintjob] = 999;
                                                            if(PlayerInfo[playerid][VipActive] != 0)
                                                            {
                                                                GivePlayerEuros(playerid, -price/2);
                                                                Businesses[i][Products]-= 15;
                                                                Businesses[i][Till]+=price/2;
                                                                OnPlayerDataSave(playerid);
                                                            }
                                                            else
                                                            {
                                                                GivePlayerEuros(playerid, -price);
                                                                Businesses[i][Products]-= 20;
                                                                Businesses[i][Till]+=price;
                                                            }
                                                            if(PlayerInfo[playerid][CarKey1] == 999)
                                                            {
                                                                PlayerInfo[playerid][CarKey1] = c+1;
                                                                DynamicCars[c][CarX] = 37.3527;
                                                                DynamicCars[c][CarY] = -235.5364;
                                                                DynamicCars[c][CarZ] = 1.6255;
                                                                DynamicCars[c][CarAngle] = 259.4858;
                                                                DynamicCars[c][Multas] = 0;
                                                                DynamicCars[c][Licenca] = 0;
                                                            }
                                                            else if(PlayerInfo[playerid][CarKey2] == 999)
                                                            {
                                                                PlayerInfo[playerid][CarKey2] = c+1;
                                                                DynamicCars[c][CarX] = 37.3527;
                                                                DynamicCars[c][CarY] = -235.5364;
                                                                DynamicCars[c][CarZ] = 1.6255;
                                                                DynamicCars[c][CarAngle] = 259.4858;
                                                                DynamicCars[c][Multas] = 0;
                                                                DynamicCars[c][Licenca] = 0;
                                                            }
                                                            else if(PlayerInfo[playerid][CarKey3] == 999)
                                                            {
                                                                PlayerInfo[playerid][CarKey3] = c+1;
                                                                DynamicCars[c][CarX] = 37.3527;
                                                                DynamicCars[c][CarY] = -235.5364;
                                                                DynamicCars[c][CarZ] = 1.6255;
                                                                DynamicCars[c][CarAngle] = 259.4858;
                                                                DynamicCars[c][Multas] = 0;
                                                                DynamicCars[c][Licenca] = 0;
                                                            }
                                                            else if(PlayerInfo[playerid][CarKey4] == 999)
                                                            {
                                                                PlayerInfo[playerid][CarKey4] = c+1;
                                                                DynamicCars[c][CarX] = 37.3527;
                                                                DynamicCars[c][CarY] = -235.5364;
                                                                DynamicCars[c][CarZ] = 1.6255;
                                                                DynamicCars[c][CarAngle] = 259.4858;
                                                                DynamicCars[c][Multas] = 0;
                                                                DynamicCars[c][Licenca] = 0;
                                                            }
                                                            else if(PlayerInfo[playerid][CarKey5] == 999)
                                                            {
                                                                PlayerInfo[playerid][CarKey5] = c+1;
                                                                DynamicCars[c][CarX] = 37.3527;
                                                                DynamicCars[c][CarY] = -235.5364;
                                                                DynamicCars[c][CarZ] = 1.6255;
                                                                DynamicCars[c][CarAngle] = 259.4858;
                                                                DynamicCars[c][Multas] = 0;
                                                                DynamicCars[c][Licenca] = 0;
                                                            }
                                                            else if(PlayerInfo[playerid][CarKey6] == 999)
                                                            {
                                                                PlayerInfo[playerid][CarKey6] = c+1;
                                                                DynamicCars[c][CarX] = 37.3527;
                                                                DynamicCars[c][CarY] = -235.5364;
                                                                DynamicCars[c][CarZ] = 1.6255;
                                                                DynamicCars[c][CarAngle] = 259.4858;
                                                                DynamicCars[c][Multas] = 0;
                                                                DynamicCars[c][Licenca] = 0;
                                                            }
                                                            SaveDynamicCars();
                                                            DestroyVehicle(c+1);
                                                            CreateVehicle(DynamicCars[c][CarModel],DynamicCars[c][CarX],DynamicCars[c][CarY],DynamicCars[c][CarZ],DynamicCars[c][CarAngle],DynamicCars[c][CarColor1],DynamicCars[c][CarColor2], -1);
                                                            OnPlayerDataSave(playerid);
                                                            return 1;
                                                        }
                                                        else
                                                        {
                                                            SendClientMessage(playerid, COLOR_RED, "[ERRO:] Nгo tens dinheiro suficiente!");
                                                            return 1;
                                                        }
                                                    }
                                                    else
                                                    {
                                                        SendClientMessage(playerid, COLOR_RED, "[ERRO:] Modelo Invбlido.");
                                                        return 1;
                                                    }
                                                }
                                            }
                                            //SendClientMessage(playerid, COLOR_RED, "[ERRO:] Sem Veiculos em Stock, fala com um Head Admin / ST-Owner.");
                                        }
                                        //SendClientMessage(playerid, COLOR_RED, "[ERRO:] Sem Veiculos em Stock, fala com um Head Admin / ST-Owner.");
                                    }
                                    //SendClientMessage(playerid, COLOR_RED, "[ERRO:] Sem Veiculos em Stock, fala com um Head Admin / ST-Owner.");
                                    return 1;
                                }
                                else
                                {
                                    SendClientMessage(playerid, COLOR_RED, "[ERRO:] Nгo estбs no stand!");
                                    return 1;
                                }
                            }
                        }
                    }
                }
            }
Mas nгo consigo entender como fazer atravйs de model textdraws.
esperando por ajuda +REP a quem ajudar
Reply
#2

Essa include aqui me foi muito ъtil: https://sampforum.blast.hk/showthread.php?tid=407045
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)