[pomoc] update texta

Započeo sampzone, Jun 07, 2011, 21:24:45 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

mod koji ja korisitm: BU

problem: napravio sam 3D na kucama...ali kada kucu kupim ne promjeni se 3D da pise ime vlasnika..itd...nego kada tek bude server restart promjeni se...

dio skripte:
evo vam 3D
if(HouseInfo[h][hOwned] == 0)
{
format(PropertyString,sizeof(PropertyString),"Kuca na Prodaju! \n Adresa: %s \n Kucni br: %d \n Level: %d \n Cijena: $%d \n Da kupite: /buyhouse",HouseInfo[h][hDiscription], HouseInfo[h][hWorld], HouseInfo[h][hLevel], HouseInfo[h][hValue]);
HouseLabel[h] = Create3DTextLabel(PropertyString ,0x00FF00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, 0, 1);
AddStaticPickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
}
else if(HouseInfo[h][hOwned] == 1)
{
format(PropertyString,sizeof(PropertyString),"Vlasnik %s \n Adresa: %s \n Kucni br: %d \n Level: %d \n Cijena renta: $%d  \n Najam: /rentroom", HouseInfo[h][hOwner], HouseInfo[h][hDiscription], HouseInfo[h][hWorld], HouseInfo[h][hLevel], HouseInfo[h][hRent]);
HouseLabel[h] = Create3DTextLabel(PropertyString ,0x00FFFFFF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, 0, 1);
AddStaticPickup(1239, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
}
}



a evo vam update 3D
public OnPropTextdrawUpdate(update, id)
{
new PropertyString[256];
if(update == 1)
{
if(HouseInfo[id][hOwned] == 0)
{
   
        Delete3DTextLabel(HouseLabel[id]);
    format(PropertyString,sizeof(PropertyString),"Kuca se Prodaje! \n ID Kuce: %d \n Cijena: $%d \n Opis: %s \n Level: %d",HouseInfo[id][hWorld], HouseInfo[id][hValue],HouseInfo[id][hDiscription], HouseInfo[id][hLevel]);
HouseLabel[id] = Create3DTextLabel(PropertyString ,0x00FF00AA,HouseInfo[id][hEntrancex], HouseInfo[id][hEntrancey], HouseInfo[id][hEntrancez],25, 0, 1);
}
}
else if(HouseInfo[id][hOwned] == 1)
{
    Delete3DTextLabel(HouseLabel[id]);
format(PropertyString,sizeof(PropertyString),"%s \n Vlasnik: %s \n ID Kuce: %d \n Rent Cijena: $%d \n Opis: %s \n Da biste rentali /rentroom", HouseInfo[id],HouseInfo[id][hOwner],HouseInfo[id][hWorld], HouseInfo[id][hRent], HouseInfo[id][hDiscription]);
HouseLabel[id] = Create3DTextLabel(PropertyString ,0x00FFFFAA,HouseInfo[id][hEntrancex], HouseInfo[id][hEntrancey], HouseInfo[id][hEntrancez],25, 0, 1);
}

    return 1;
}


slike:/

Hvala za pomoc unaprijed!

N0NE

pod buy komandu stavi OnPropTextdrawUpdate(update, id);

for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hOwned] == 0)
{
format(PropertyString,sizeof(PropertyString),"Kuca na Prodaju! \n Adresa: %s \n Kucni br: %d \n Level: %d \n Cijena: $%d \n Da kupite: /buyhouse",HouseInfo[h][hDiscription], HouseInfo[h][hWorld], HouseInfo[h][hLevel], HouseInfo[h][hValue]);
HouseLabel[h] = Create3DTextLabel(PropertyString ,0x00FF00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, 0, 1);
AddStaticPickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
}
else if(HouseInfo[h][hOwned] == 1)
{
format(PropertyString,sizeof(PropertyString),"Vlasnik %s \n Adresa: %s \n Kucni br: %d \n Level: %d \n Cijena renta: $%d  \n Najam: /rentroom", HouseInfo[h][hOwner], HouseInfo[h][hDiscription], HouseInfo[h][hWorld], HouseInfo[h][hLevel], HouseInfo[h][hRent]);
HouseLabel[h] = Create3DTextLabel(PropertyString ,0x00FFFFFF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, 0, 1);
AddStaticPickup(1239, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
}
}
ž
Evo probaj ovak oovaj prvi dio a drugi ostavi tako.

eto ubacio sam to tvoje i nece...al ubacio sam i pod /buyhouse da mi update text ovako:
OnPropTextdrawUpdate(1, h); ..to sam preuzeo iz ravensa posto sam odatke i uzeo 3D al opet nece...a kada ubacim ovako
OnPropTextdrawUpdate(update, id); izbaci mi error da ne prepozna update

Citat: sampzone poslato Jun 07, 2011, 23:02:25 POSLE PODNE
eto ubacio sam to tvoje i nece...al ubacio sam i pod /buyhouse da mi update text ovako:
OnPropTextdrawUpdate(1, h); ..to sam preuzeo iz ravensa posto sam odatke i uzeo 3D al opet nece...a kada ubacim ovako
OnPropTextdrawUpdate(update, id); izbaci mi error da ne prepozna update
Stavi ovo OnPropTextdrawUpdate(1, h);
i stavi ovo
OnPropUpdate(1,h);
OnPlayerUpdateEx(playerid);

C:\DOCUME~1\Brkovic\Desktop\BUMOD~1\MOD\GAMEMO~1\BALKAN~1.PWN(33088) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Brkovic\Desktop\BUMOD~1\MOD\GAMEMO~1\BALKAN~1.PWN(33088) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Brkovic\Desktop\BUMOD~1\MOD\GAMEMO~1\BALKAN~1.PWN(33089) : error 017: undefined symbol "OnPlayerUpdateEx"
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

33088:
OnPropUpdate(1,h);

33089:
OnPlayerUpdateEx(playerid);

ja mislim da umjesto ovog:
OnPropUpdate(1,h);

treba ici ovo:
OnPropUpdate(1);

Di si stavio to sve stavi ovako ovo troje pod komandu /buyhouse ili kako vec ti ide komanda.
stavi ovo dvoje u tu tvoju komandu :
OnPropTextdrawUpdate(1, h);
OnPropUpdate(1,h);

naravno moras imati forward :
forward OnPropUpdate(update,idx);
forward OnPropTextdrawUpdate(update, id);


Poslednja Izmena: Jun 07, 2011, 23:33:40 POSLE PODNE od [LYG] $--L84S--$

nista ja tebe ne razumijem....ovo troje sto si mi dao stavio sam u komandu /buyhouse...a za OnPropTextdrawUpdate imam forward ovakav na vrhu...zato sto vec imam public u modu...a ovo OnPropUpdate sacu da stavim i dacu ti errore

Citat: sampzone poslato Jun 07, 2011, 23:48:47 POSLE PODNE
nista ja tebe ne razumijem....ovo troje sto si mi dao stavio sam u komandu /buyhouse...a za OnPropTextdrawUpdate imam forward ovakav na vrhu...zato sto vec imam public u modu...a ovo OnPropUpdate sacu da stavim i dacu ti errore
Kako nekuzis znaci ovo dvoje :
OnPropTextdrawUpdate(1, h);
OnPropUpdate(1,h);

Stavi u tu tvoju komandu za kupovinu kuce /kupikucu ili /buyhouse kako vec ti je ta komanda.
ili ako neznas stavi kumandu za kupovinu kuce.
Poslednja Izmena: Jun 07, 2011, 23:53:30 POSLE PODNE od [LYG] $--L84S--$

eto dodao sam to dvoje i izbaci mi ove warninge:
C:\DOCUME~1\Brkovic\Desktop\BUMOD~1\MOD\GAMEMO~1\BALKAN~1.PWN(33088) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Brkovic\Desktop\BUMOD~1\MOD\GAMEMO~1\BALKAN~1.PWN(33088) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings. a red 33088 je:
OnPropUpdate(1,h);

probaj samo OnPropUpdate(1);  ili obrnuto
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √

probavo sam i nece.....evo vam moja komanda /buyhouse kako sad izgleda pa mi pls pomozite
if(strcmp(cmd, "/buyhouse", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
new Float:oldposx, Float:oldposy, Float:oldposz;
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(PlayerToPoint(2.0, playerid, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 0)
{
if(PlayerInfo[playerid][pLevel] < HouseInfo[h][hLevel])
{
format(string, sizeof(string), "   Morate biit Level %d da biste kupili ovo !", HouseInfo[h][hLevel]);
SendClientMessage(playerid, COLOR_GRAD5, string);
return 1;
}
if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "   Vec posjedujete kucu, kucajte /sellhouse ako zelite da kupite ovu !");
return 1;
}
if(GetPlayerMoney(playerid) > HouseInfo[h][hValue])
{
    Delete3DTextLabel(Text3D:housesale);
PlayerInfo[playerid][pPhousekey] = h;
HouseInfo[h][hOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
SafeGivePlayerMoney(playerid,-HouseInfo[h][hValue]);
/*SetPlayerInterior(playerid,HouseInfo[h][hInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[h][hWorld]);
SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);*/
GameTextForPlayer(playerid, "~w~Dobrodosli Kuci~n~Mozete uvjek izaci tako sto cete doci do ulaznih vrata i kucati /exit", 5000, 3);
PlayerInfo[playerid][pInt] = HouseInfo[h][hInt];
PlayerInfo[playerid][pLocal] = h;
SendClientMessage(playerid, COLOR_WHITE, "Cestitamo vam na kupovini nove kuce !");
SendClientMessage(playerid, COLOR_WHITE, "Kucajte /help da biste dobili pomoc vezanu za kucu !");
Delete3DTextLabel(Text3D:housesale);
OnPropTextdrawUpdate(1, h);
                        DateProp(playerid);
OnPropUpdate();
OnPlayerUpdateCustom(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "   Nemate dovoljno novca za kupovinu !");
return 1;
}
}
}
}
return 1;
}

Citat: sampzone poslato Jun 08, 2011, 12:19:51 POSLE PODNE
probavo sam i nece.....evo vam moja komanda /buyhouse kako sad izgleda pa mi pls pomozite
if(strcmp(cmd, "/buyhouse", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
new Float:oldposx, Float:oldposy, Float:oldposz;
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(PlayerToPoint(2.0, playerid, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 0)
{
if(PlayerInfo[playerid][pLevel] < HouseInfo[h][hLevel])
{
format(string, sizeof(string), "   Morate biit Level %d da biste kupili ovo !", HouseInfo[h][hLevel]);
SendClientMessage(playerid, COLOR_GRAD5, string);
return 1;
}
if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "   Vec posjedujete kucu, kucajte /sellhouse ako zelite da kupite ovu !");
return 1;
}
if(GetPlayerMoney(playerid) > HouseInfo[h][hValue])
{
    Delete3DTextLabel(Text3D:housesale);
PlayerInfo[playerid][pPhousekey] = h;
HouseInfo[h][hOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
SafeGivePlayerMoney(playerid,-HouseInfo[h][hValue]);
/*SetPlayerInterior(playerid,HouseInfo[h][hInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[h][hWorld]);
SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);*/
GameTextForPlayer(playerid, "~w~Dobrodosli Kuci~n~Mozete uvjek izaci tako sto cete doci do ulaznih vrata i kucati /exit", 5000, 3);
PlayerInfo[playerid][pInt] = HouseInfo[h][hInt];
PlayerInfo[playerid][pLocal] = h;
SendClientMessage(playerid, COLOR_WHITE, "Cestitamo vam na kupovini nove kuce !");
SendClientMessage(playerid, COLOR_WHITE, "Kucajte /help da biste dobili pomoc vezanu za kucu !");
Delete3DTextLabel(Text3D:housesale);
OnPropTextdrawUpdate(1, h);
                        DateProp(playerid);
OnPropUpdate();
OnPlayerUpdateCustom(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "   Nemate dovoljno novca za kupovinu !");
return 1;
}
}
}
}
return 1;
}

Ostavi tako i kada t inetko kupi kucu morat ce cekati GMX i mislim da ti treba raditi poslije GMX.

http://wiki.sa-mp.com/wiki/Update3DTextLabelText

ili ovo sa brisanjem postojeceg i kreiranjem novog labela(u tvom slucaju "OnProp...")