Quote:
Originally Posted by [GF]Sasino97
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(playerid, afk[playerid]); // 2 Errors here
Quote:
Originally Posted by Jochemd
Can you actually script, tyler12?
|
LOOL gtfo