/label problem [may give you an idea] -
CROSS_Hunter - 09.08.2012
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
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;
}
deletelabel command
pawn Код:
dcmd_deletelabel(playerid,params[])
{
#pragma unused params
Update3DTextLabelText(ltext[playerid], 0xFFFFFFAA, " ");//making it invisible
return 1;
}
Re: /label problem [may give you an idea] -
CROSS_Hunter - 09.08.2012
help? its serious
Re: /label problem [may give you an idea] -
CROSS_Hunter - 09.08.2012
please help guys there arelots fo good ppl here
Re: /label problem [may give you an idea] -
IceMeteor - 09.08.2012
You dont have to loop it
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;
}
format(string,sizeof(string),"%s",params);
Update3DTextLabelText(ltext[playerid], 0xFFFFFFAA, string);
Attach3DTextLabelToPlayer(ltext[playerid], playerid, 0.0, 0.0, 0.6);
return 1;
}
Re: /label problem [may give you an idea] -
[MM]RoXoR[FS] - 09.08.2012
Why are you using a loop
pawn Код:
dcmd_label(playerid,params[])
{
//#pragma unused params seriously? you are using params
new string[128];
if(sscanf(params,"s[128]",string)) return SendClientMessage(playerid,COLOR_ERROR,"USAGE: /label (Text)");
if(IsSpawned[playerid] == 0)return SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
Update3DTextLabelText(ltext[playerid], 0xFFFFFFAA, string);
Attach3DTextLabelToPlayer(ltext[playerid], playerid, 0.0, 0.0, 0.6);
return 1;
}
Re: /label problem [may give you an idea] -
CROSS_Hunter - 09.08.2012
Quote:
Originally Posted by IceMeteor
You dont have to loop it
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; } format(string,sizeof(string),"%s",params); Update3DTextLabelText(ltext[playerid], 0xFFFFFFAA, string); Attach3DTextLabelToPlayer(ltext[playerid], playerid, 0.0, 0.0, 0.6); return 1; }
|
thanks alot bro

rep +
Re: /label problem [may give you an idea] -
CROSS_Hunter - 09.08.2012
Quote:
Originally Posted by [MM]RoXoR[FS]
Why are you using a loop
pawn Код:
dcmd_label(playerid,params[]) { //#pragma unused params seriously? you are using params
new string[128]; if(sscanf(params,"s[128]",string)) return SendClientMessage(playerid,COLOR_ERROR,"USAGE: /label (Text)"); if(IsSpawned[playerid] == 0)return SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
Update3DTextLabelText(ltext[playerid], 0xFFFFFFAA, string); Attach3DTextLabelToPlayer(ltext[playerid], playerid, 0.0, 0.0, 0.6); return 1; }
|
dude.. ofcourse i need params because its not a stable text they can change it when ever they want they can write what ever they want and if ur so genius u just commented on #pargma unused paramas and u forgot that it will give u a warning becuz dcmd_label(playerid,
params[])
Re: /label problem [may give you an idea] -
[MM]RoXoR[FS] - 09.08.2012
Quote:
Originally Posted by CROSS_Hunter
dude.. ofcourse i need params because its not a stable text they can change it when ever they want they can write what ever they want and if ur so genius u just commented on #pargma unused paramas and u forgot that it will give u a warning becuz dcmd_label(playerid,params[])
|
I am sure you have not even tested it.
Код:
#pragma unused params
tells the compiler that you have not used it and hence you do not get any Symbol Never Used Warning.
But if look in my/your script, you have used params quite a few times.
So there was no need to add #pragma unused params.
I hope you get it.
Re: /label problem [may give you an idea] -
CROSS_Hunter - 09.08.2012
Quote:
Originally Posted by [MM]RoXoR[FS]
I am sure you have not even tested it.
Код:
#pragma unused params
tells the compiler that you have not used it and hence you do not get any Symbol Never Used Warning.
But if look in my/your script, you have used params quite a few times.
So there was no need to add #pragma unused params.
I hope you get it.
|
dude ok i get u but the problem is still the same the label of the player beside me disappears when i set my label why is that? what code should i use ? help
Re: /label problem [may give you an idea] -
CROSS_Hunter - 09.08.2012
help any one?