09.08.2012, 11:59
i have made a /label command which when you write /label <Text> it appears above your head but the problem is when i write it all the players in the server who wrote /label <text> its removed from their head and its only me and if i wrote /deletelabel it deletes the whole player's texts
deletelabel command
pawn Код:
//at the very top
new Text3D:ltext[MAX_PLAYERS];
pawn Код:
dcmd_label(playerid,params[])
{
#pragma unused params
new string[128];
if(!strlen(params))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /label (Text)");
return 1;
}
if(IsSpawned[playerid] == 0)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
format(string,sizeof(string),"%s",params);
Update3DTextLabelText(ltext[playerid], 0xFFFFFFAA, string);
Attach3DTextLabelToPlayer(ltext[playerid], playerid, 0.0, 0.0, 0.6);
return 1;
}
return 1;
}
pawn Код:
dcmd_deletelabel(playerid,params[])
{
#pragma unused params
Update3DTextLabelText(ltext[playerid], 0xFFFFFFAA, " ");//making it invisible
return 1;
}