Scripting problem [help with attach3DTextLabelToPlayer]
#3

Quote:
Originally Posted by (*|Flake|*)
Посмотреть сообщение
thats because you havn't defined that only you can do the command, at the moment anyone who does the command can have it on there head

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   
    if (strcmp("/soj2968", cmdtext, true, 10) == 0)
{
    new PlayerName[24]; // We create a variable which will contain the players name.
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    if(strcmp(PlayerName,"your name here",true)) // We use strcmp to check if the player who entered the car is the same as ''
     {
    new Text3D:label = Create3DTextLabel("World Wide Roleplay Server Owner", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
    Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.5);
}
    return 1;
}
havnt tested this but use somthing along the lines of this
i think the parameter size in strcmp should be ignored or set to the same size? like
pawn Код:
if(strcmp("/soj2968",cmdtext,true) == 0)
or maybe simply like
pawn Код:
if(!strcmp("/soj2968",cmdtext,true))
btw for the color codes, see https://sampwiki.blast.hk/wiki/Hex and https://sampwiki.blast.hk/wiki/Colors_Li...d_player_color
and the color is not changed in pawn but in game :P
also i think you can't see your own 3D Text Label (attached with Attach3DTextLabelToPlayer), it may only visible for other player(s).
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)