[AJUDA] passar de Create3DTextLabel para GameTextForPlayer
#1

Boa Tarde,

A maior parte de vуs deve conhecer o famoso gamemode Ravens RolePlay, eu agora estou a utilizar essa Gamemode no meu servidor, a corrigir alguns bugs e a alterar algumas coisas.

-Uma das coisas que gostava de alterar era a maneira de como se dispoe a informaзao das casas e dos bizz

- Original:

pawn Код:
format(PropertyString,sizeof(PropertyString),"House is UNOWNED! \n House ID: %d \n Price: $%d \n Description: %s \n Level Needed: %d",HouseInfo[h][hWorld], HouseInfo[h][hValue],HouseInfo[h][hDiscription], HouseInfo[h][hLevel]);
HouseLabel[h] = Create3DTextLabel(PropertyString ,0x00FF00AA,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, 0, 1);
HousePickup[h] = CreateDynamicPickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
- Pretendido
pawn Код:
format(PropertyString,sizeof(PropertyString),"House is UNOWNED! \n House ID: %d \n Price: $%d \n Description: %s \n Level Needed: %d",HouseInfo[h][hWorld], HouseInfo[h][hValue],HouseInfo[h][hDiscription], HouseInfo[h][hLevel]);
if(IsPlayerInRangeOfPoint(playerid, 10.0, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]));
{
GameTextForPlayer(playerid, PropertyString, 3000, 4);
return 1:
}
-ou seja

Mais ao menos disto:


Para isto: (ficando sу a parte que aparece no ecra e com o pickup )
Reply
#2

Olб brunox,

vocк sabe se existe uma variбvel ou algo do tipo que defina uma quantidade mбxima de casas no servidor ?
Reply
#3

Nao, pelo mesnos eu nao encontro
Reply
#4

Olб brunox,

adicione isto em OnPlayerPickUpPickup:

pawn Код:
for(new ii; ii != QUANT_MAXIMO_CASAS; ii++)
{
    if(pickupid == HousePickup[ii])
    {
        format(PropertyString,sizeof(PropertyString),"House is UNOWNED! \n House ID: %d \n Price: $%d \n Description: %s \n Level Needed: %d",HouseInfo[ii][hWorld], HouseInfo[ii][hValue],HouseInfo[ii][hDiscription], HouseInfo[ii][hLevel]);
        GameTextForPlayer(playerid, PropertyString, 3000, 4);
    }
}
troque QUANT_MAXIMO_CASAS, pela quantia mбxima de casas do servidor caso encontrei algum valor.


Atenciosamente,
Falcon.
Reply
#5

+rep

Mas nao dб, eu vou enviar mais umas linhas

pawn Код:
for(new h = 0; h < sizeof(HouseInfo); h++)
    {
        if(HouseInfo[h][hSetted] == 1)
        {
            if(HouseInfo[h][hOwned] == 0)
            {
                if(HouseInfo[h][hSetted] == 1)
                {
                    format(PropertyString,sizeof(PropertyString),"House is UNOWNED! \n House ID: %d \n Price: $%d \n Description: %s \n Level Needed: %d",HouseInfo[h][hWorld], HouseInfo[h][hValue],HouseInfo[h][hDiscription], HouseInfo[h][hLevel]);
                    HouseLabel[h] = Create3DTextLabel(PropertyString ,0x00FF00AA,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, 0, 1);
                    HousePickup[h] = CreateDynamicPickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
                }
            }
            else if(HouseInfo[h][hOwned] == 1)
            {
                format(PropertyString,sizeof(PropertyString),"%s \n Owner: %s \n House ID: %d \n Rent Price: $%d \n Description: %s \n To Rent Type /rentroom",HouseInfo[h][hMessage],HouseInfo[h][hOwner],HouseInfo[h][hWorld], HouseInfo[h][hRent], HouseInfo[h][hDiscription]);
                HouseLabel[h] = Create3DTextLabel(PropertyString ,0x00FFFFAA,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, 0, 1);
                HousePickup[h] = CreateDynamicPickup(1272, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
            }
        }
    }
Reply
#6

nгo estб aparecendo o GameText ?

tente desta forma:
pawn Код:
for(new ii; ii != sizeof(HouseInfo); ii++)
{
    if(pickupid == HousePickup[ii])
    {
        format(PropertyString,sizeof(PropertyString),"House is UNOWNED! \n House ID: %d \n Price: $%d \n Description: %s \n Level Needed: %d",HouseInfo[ii][hWorld], HouseInfo[ii][hValue],HouseInfo[ii][hDiscription], HouseInfo[ii][hLevel]);
        GameTextForPlayer(playerid, PropertyString, 3000, 4);
    }
}
caso nгo dк poste a variбvel HousePickup, "new HousePickup[...]"
Reply
#7

dб estes erros:

Quote:

C:\Users\Bruno\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(15295) : error 017: undefined symbol "jj"
C:\Users\Bruno\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(15295) : error 001: expected token: ";", but found "sizeof"
C:\Users\Bruno\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(15295) : warning 215: expression has no effect
C:\Users\Bruno\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(15295) : error 001: expected token: ")", but found ";"
C:\Users\Bruno\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(15295) : fatal error 107: too many error messages on one line

pawn Код:
new HousePickup[sizeof(HouseInfo)];
Reply
#8

editei minha mensagem acima, tente novamente.
Reply
#9

o que esta na tua messagem anterior foi o que eu tinha posto, e deu os erros que referi acima
Reply
#10

alguem pode ajudar ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)