19.09.2017, 17:04
I need this command where if a player types: /channel 1 it displays "Channel: 1" above their head, if they type channel 2 it displays "Channel: 2" above their head and so on..
If the player already has "Channel 1" displayed above their head and the player decides to switch to /channel 2 it has to change to "Channel 2"
I've been trying all day to get this to work but I cannot manage to get it done, here is what I have:
I don't know if this is anywhere close to what it's supposed to be but I don't know..
If you can help me that'd be great. Thanks in advance.
If the player already has "Channel 1" displayed above their head and the player decides to switch to /channel 2 it has to change to "Channel 2"
I've been trying all day to get this to work but I cannot manage to get it done, here is what I have:
PHP код:
CMD:channel(playerid,params[])
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "/channel (Channel ID)");
{
if(!strcmp(params, "1", true, 7))
{
Channel1[playerid] = Create3DTextLabel("Channel: 1", 0xE91616FF, 0, 0, 0, 17, 0, 1);
Attach3DTextLabelToPlayer(Channel1[playerid], playerid, 0.0, 0.0, 0.275);
PlayerGlobalMessage(playerid,20.0, "Has switched to channel 1.");
}
else if(!strcmp(params, "2", true, 7))
{
Channel2[playerid] = Create3DTextLabel("Channel: 2", 0xE91616FF, 0, 0, 0, 17, 0, 1);
Attach3DTextLabelToPlayer(Channel2[playerid], playerid, 0.0, 0.0, 0.275);
PlayerGlobalMessage(playerid,20.0, "Has switched to channel 2.");
Delete3DTextLabel(Channel1[playerid]);
}
}
return 1;
}
If you can help me that'd be great. Thanks in advance.