DeletePlayer3DTextLabel
#1

pawn Code:
COMMAND:afk(playerid, params[])
{
new string[128], playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(string, sizeof(string), "SERVER:%s is now in afk mode!", playerName);
SendClientMessageToAll(blue, string);
TogglePlayerControllable(playerid, 0);
new Text3D:afk = Create3DTextLabel("Player is afk!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(afk, playerid, 0.0, 0.0, 0.7);
return 1;
}
COMMAND:back(playerid, params[])
{
new string[128], playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(string, sizeof(string), "SERVER:%s has came back from being afk!", playerName);
SendClientMessageToAll(blue, string);
TogglePlayerControllable(playerid, 1);
DeletePlayer3DTextLabel(playerid, PlayerText3D:afk);//line of error
return 1;
}
I keep getting a error
Code:
(3827) : error 017: undefined symbol "afk"
Reply
#2

Replace the error line with this:
pawn Code:
DeletePlayer3DTextLabel(playerid,afk);
Reply
#3

Still getting same error :S
Reply
#4

At top of your script
new Text3D:afk[MAX_PLAYERS];
Reply
#5

Code:
(3817) : warning 219: local variable "afk" shadows a variable at a preceding level
(3828) : error 035: argument type mismatch (argument 2)
pawn Code:
new Text3D:afk = Create3DTextLabel("Player is afk!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); // first error 3817
DeletePlayer3DTextLabel(playerid,afk); // second error 3828
Reply
#6

PHP Code:
new Text3D:awayFKCreate3DTextLabel("Player is afk!"0x008080FF30.040.050.040.00); // first error 3817
DeletePlayer3DTextLabel(playeridawayFK); 
Reply
#7

Quote:
Originally Posted by tyler12
View Post
pawn Code:
COMMAND:afk(playerid, params[])
{
new string[128], playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(string, sizeof(string), "SERVER:%s is now in afk mode!", playerName);
SendClientMessageToAll(blue, string);
TogglePlayerControllable(playerid, 0);
new Text3D:afk = Create3DTextLabel("Player is afk!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(afk, playerid, 0.0, 0.0, 0.7);
return 1;
}
COMMAND:back(playerid, params[])
{
new string[128], playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(string, sizeof(string), "SERVER:%s has came back from being afk!", playerName);
SendClientMessageToAll(blue, string);
TogglePlayerControllable(playerid, 1);
DeletePlayer3DTextLabel(playerid, PlayerText3D:afk);//line of error
return 1;
}
I keep getting a error
Code:
(3827) : error 017: undefined symbol "afk"
Code:
COMMAND:afk(playerid, params[])
{
    new string[128], playerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
    format(string, sizeof(string), "SERVER:%s is now in afk mode!", playerName);
    SendClientMessageToAll(blue, string);
    TogglePlayerControllable(playerid, 0);
    new Text3D:afk = Create3DTextLabel("Player is afk!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
    Attach3DTextLabelToPlayer(afk, playerid, 0.0, 0.0, 0.7);
    return 1;
}

COMMAND:back(playerid, params[])
{
    new string[128], playerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
    format(string, sizeof(string), "SERVER:%s has came back from being afk!", playerName);
    SendClientMessageToAll(blue, string);
    TogglePlayerControllable(playerid, 1);
    DeletePlayer3DTextLabel(playerid, PlayerText3D:afk);
    return 1;
}
Reply
#8

Quote:
Originally Posted by tyler12
View Post
pawn Code:
COMMAND:afk(playerid, params[])
{
new string[128], playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(string, sizeof(string), "SERVER:%s is now in afk mode!", playerName);
SendClientMessageToAll(blue, string);
TogglePlayerControllable(playerid, 0);
new Text3D:afk = Create3DTextLabel("Player is afk!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(afk, playerid, 0.0, 0.0, 0.7);
return 1;
}
COMMAND:back(playerid, params[])
{
new string[128], playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(string, sizeof(string), "SERVER:%s has came back from being afk!", playerName);
SendClientMessageToAll(blue, string);
TogglePlayerControllable(playerid, 1);
DeletePlayer3DTextLabel(playerid, PlayerText3D:afk);//line of error
return 1;
}
I keep getting a error
Code:
(3827) : error 017: undefined symbol "afk"
pawn Code:
COMMAND:afk(playerid, params[])
{
new string[128], playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(string, sizeof(string), "SERVER:%s is now in afk mode!", playerName);
SendClientMessageToAll(blue, string);
new Text3D:afk = Create3DTextLabel("Player is afk!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(afk, playerid, 0.0, 0.0, 0.7);
TogglePlayerControllable(playerid, 0);
return 1;
}
COMMAND:back(playerid, params[])
{
new string[128], playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(string, sizeof(string), "SERVER:%s has came back from being afk!", playerName);
SendClientMessageToAll(blue, string);
TogglePlayerControllable(playerid, 1);
DeletePlayer3DTextLabel(playerid, Text3D:afk);
return 1;
}
That should work
Reply
#9

and download the new streamer plugin 2.6 by Incognito https://sampforum.blast.hk/showthread.php?tid=102865
Reply
#10

Quote:
Originally Posted by sampmark05
View Post
and download the new streamer plugin 2.6 by Incognito https://sampforum.blast.hk/showthread.php?tid=102865
My streamer is updated.

Now i get 2 warnings
(3826) : warning 219: local variable "afk" shadows a variable at a preceding level
(383 : warning 213: tag mismatch

Lines
3826 - new Text3D:afk = Create3DTextLabel("Player is afk!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
3838 - DeletePlayer3DTextLabel(playerid, Text3D:afk);

EDIT: Ingame label dosent show
Reply
#11

Did you even read what I wrote above?
Reply
#12

Quote:
Originally Posted by Twisted_Insane
View Post
Did you even read what I wrote above?
Yes, it did not do anything...
Reply
#13

Can you actually script, tyler12?
Reply
#14

Do like this:

At top of your script
new Text3D:afk;

Then go to the line
"new Text3D:afk = Create3DTextLabel("Player is afk!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);."

and delete the 'new Text3D:'
Reply
#15

dude one minute please see that u add new Text3D:afk[MAX_PLAYERS]; at top then what mistake you have done is

you have added new "Text3D:afk" in the command /afk. just remove the new

heres the code
pawn Code:
new Text3D: afk[MAX_PLAYERS]; // at your top of script

COMMAND:afk(playerid, params[])
{
     new string[128], playerName[MAX_PLAYER_NAME];
     GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
     format(string, sizeof(string), "SERVER:%s is now in afk mode!", playerName);
     SendClientMessageToAll(blue, string);
     Text3D:afk = Create3DTextLabel("Player is afk!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
    Attach3DTextLabelToPlayer(afk, playerid, 0.0, 0.0, 0.7);
    TogglePlayerControllable(playerid, 0);
    return 1;
}
COMMAND:back(playerid, params[])
{
     new string[128], playerName[MAX_PLAYER_NAME];
     GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
     format(string, sizeof(string), "SERVER:%s has came back from being afk!", playerName);
     SendClientMessageToAll(blue, string);
     TogglePlayerControllable(playerid, 1);
     DeletePlayer3DTextLabel(playerid, Text3D:afk);
     return 1;
}
Hope It Helped
Reply
#16

Fix to this(there were a 3 or 4 errors) or it will give you an error like "Array has to be indexed", and another error with DeletePlayer3DTextLabel, it has to be Delete3DTextLabel, because afk is of type Text3D, not PlayerText3D, else it will give an error like "Argument type mismatch"

pawn Code:
new Text3D: afk[MAX_PLAYERS]; // at your top of script

COMMAND:afk(playerid, params[])
{
     new string[128], playerName[MAX_PLAYER_NAME];
     GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
     format(string, sizeof(string), "SERVER:%s is now in afk mode!", playerName);
     SendClientMessageToAll(blue, string);
     afk[playerid] = Create3DTextLabel("Player is afk!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
     Attach3DTextLabelToPlayer(afk[playerid], playerid, 0.0, 0.0, 0.7); // 1 error here
     TogglePlayerControllable(playerid, 0);
     return 1;
}
COMMAND:back(playerid, params[])
{
     new string[128], playerName[MAX_PLAYER_NAME];
     GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
     format(string, sizeof(string), "SERVER:%s has came back from being afk!", playerName);
     SendClientMessageToAll(blue, string);
     TogglePlayerControllable(playerid, 1);
     Delete3DTextLabel(playerid, afk[playerid]); // 2 Errors here
     return 1;
}
If there's another error, let me know
Reply
#17

ohh man srry for that i was in little hurry :P nvm btw thks for telling me too next time i will see to it that i will not make mistakes.
Reply
#18

Quote:
Originally Posted by [GF]Sasino97
View Post
Fix to this(there were a 3 or 4 errors) or it will give you an error like "Array has to be indexed", and another error with DeletePlayer3DTextLabel, it has to be Delete3DTextLabel, because afk is of type Text3D, not PlayerText3D, else it will give an error like "Argument type mismatch"

pawn Code:
new Text3D: afk[MAX_PLAYERS]; // at your top of script

COMMAND:afk(playerid, params[])
{
     new string[128], playerName[MAX_PLAYER_NAME];
     GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
     format(string, sizeof(string), "SERVER:%s is now in afk mode!", playerName);
     SendClientMessageToAll(blue, string);
     afk[playerid] = Create3DTextLabel("Player is afk!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
     Attach3DTextLabelToPlayer(afk[playerid], playerid, 0.0, 0.0, 0.7); // 1 error here
     TogglePlayerControllable(playerid, 0);
     return 1;
}
COMMAND:back(playerid, params[])
{
     new string[128], playerName[MAX_PLAYER_NAME];
     GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
     format(string, sizeof(string), "SERVER:%s has came back from being afk!", playerName);
     SendClientMessageToAll(blue, string);
     TogglePlayerControllable(playerid, 1);
     Delete3DTextLabel(playerid, afk[playerid]); // 2 Errors here
     return 1;
}
If there's another error, let me know
Will that delete the 3d text label if other players are afk

Im not at a computer at the moment, ill test it soon

Thanks

EDIT:Just 2 warnings,

(3854) : warning 213: tag mismatch
(3854) : warning 202: number of arguments does not match definition
This line
PHP Code:
     Delete3DTextLabel(playeridafk[playerid]); // 2 Errors here 
Quote:
Originally Posted by Jochemd
View Post
Can you actually script, tyler12?
LOOL gtfo
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)