SA-MP Forums Archive
3d/2d text above icons? or anywhere - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 3d/2d text above icons? or anywhere (/showthread.php?tid=162113)



3d/2d text above icons? or anywhere - seifo - 22.07.2010

Well im trying to script just a name in front of a garage to tell people who the owner is, and im having alot of trouble
i'm asking if anyone can help?


Re: 3d/2d text above icons? or anywhere - Billy_Macan - 22.07.2010

What kind of name?? A text String that shows it if your within a cretin distance??


Re: 3d/2d text above icons? or anywhere - ettans - 22.07.2010

Quote:
Originally Posted by seifo
Посмотреть сообщение
Well im trying to script just a name in front of a garage to tell people who the owner is, and im having alot of trouble
i'm asking if anyone can help?
He clearly said what he wants to use it for.

pawn Код:
Create3DTextLabel("your string here",0x008080FF,garage[x],garage[y],garage[z],40.0,0);
Use a string in there to display the owner of the certain garage and for the coordinates, use the array you use for the garage system.


Re: 3d/2d text above icons? or anywhere - seifo - 22.07.2010

thanks alot bro ill check it out


Re: 3d/2d text above icons? or anywhere - seifo - 22.07.2010

getting 2 errors

Quote:

public OnPlayerText(playerid, text[])
{
if (AccountInfo[playerid][Mute] == 1)
{
SendClientMessage(playerid, RED, "You are muted! You cannot talk.");
return 0;
}
return 1;
}
Create3DTextLabel("seifo",0x008080FF,garage[1586.25],garage[1189.62],garage[23.43],40.0,0);

}

error 054: unmatched closing brace ("}")
error 010: invalid function or declaration

any ideas?


Re: 3d/2d text above icons? or anywhere - LeNy - 22.07.2010

Look This:

Код:
public OnPlayerText(playerid, text[])
{
if (AccountInfo[playerid][Mute] == 1)
{
SendClientMessage(playerid, RED, "You are muted! You cannot talk.");
return 0;
}
Create3DTextLabel("seifo",0x008080FF,garage[1586.25],garage[1189.62],garage[23.43],40.0,0);
return 1;
}



Re: 3d/2d text above icons? or anywhere - ettans - 22.07.2010

You have 1 extra closing brace in OnPlayerText. The garage[x] etc. were just examples. I'm guessing you're using an array for the garage system, like GarageInfo[garageid][PosX],GarageInfo[garageid][Owner] etc. When loading the garages, that's where you should use the Create3DTextLabel.

Here's an example, I hope you'll understand what I mean by it:

pawn Код:
stock LoadGarages()
{
    /*

        This part loads the imaginable garages

    */


    // Now that we have our garages loaded, lets place the 3DTextLabel at them, to show the owner
    new string[24];
    for(new i = 0; i < sizeof(GarageInfo); i++)
    {
        format(string,sizeof(string),"%s",GarageInfo[i][Owner]);
        Create3DTextLabel(string,0x008080FF,GarageInfo[i][PosX],GarageInfo[i][PosY],GarageInfo[i][PosZ],40.0,0);
    }
}
Here's the fix for OnPlayerChat:

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(AccountInfo[playerid][Mute] == 1)
        return SendClientMessage(playerid, RED, "You are muted! You cannot talk.");
    return 1;
}

Would be great if you could show me the way you load the garages.


Re: 3d/2d text above icons? or anywhere - seifo - 22.07.2010

they are custom ones that i built in mta and converted to creatobject

btw i want it like this if u see what i mean