VIP Tag disappears for player 1 if player 2 uses it at the same time.
#1

pawn Код:
CMD:viptag(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 1) {
        if(PlayerInfo[playerid][VIPTag] == 0)   {
            PlayerInfo[playerid][VIPTag] = 1;
            Delete3DTextLabel(PlayerInfo[playerid][Tag3D]);
            PlayerInfo[playerid][Tag3D] = Create3DTextLabel("VIP Member", blue, 0.0, 0.0, 0.0, 90.0, 0, 1);
            Attach3DTextLabelToPlayer(PlayerInfo[playerid][Tag3D], playerid, 0.0, 0.0, 1.2);
            SendClientMessage(playerid,green,"This feature has been enabled!");
            return CMDMessageToAdmins(playerid,"VIP Tag");
        } else {
            PlayerInfo[playerid][VIPTag] = 0;
            Delete3DTextLabel(PlayerInfo[playerid][Tag3D]);
            return SendClientMessage(playerid,red,"This feature has been enabled!");
        }
    } else return SendClientMessage(playerid,red,"ERROR: You need to be level 4 to use this command");
}
I would like it to work with two and even more people at the same time.
Reply
#2

I dunno how looks your PlayerInfo enum, so here is sample script I made. I hope it will be helpfull, and it is what you meant.
pawn Код:
// at the top of the script
new Text3D:vip3d[MAX_PLAYERS];
public OnGameModeInit()
{
...
for(new PlayerId = 0; PlayerId < MAX_PLAYERS; PlayerId++)
{
vip3d[PlayerId] = Create3DTextLabel("VIP Member", blue, 0.0, 0.0, -500.0, 30.0, 0, 0);
}
..
}
This code creates this 3dText for all players. Yes, it is required.
And now:
pawn Код:
// Your code modifited
CMD:viptag(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 1) {
        if(PlayerInfo[playerid][VIPTag] == 0)   {
            PlayerInfo[playerid][VIPTag] = 1;
            Attach3DTextLabelToPlayer(vip3d[playerid], playerid, 0.0, 0.0, 1.2);
            SendClientMessage(playerid,green,"This feature has been enabled!");
            return CMDMessageToAdmins(playerid,"VIP Tag");
        } else {
            PlayerInfo[playerid][VIPTag] = 0;
            Delete3DTextLabel(vip3d[playerid]);
            return SendClientMessage(playerid,red,"This feature has been enabled!");
        }
    } else return SendClientMessage(playerid,red,"ERROR: You need to be level 4 to use this command");
It should work for now.
WARNING: It might not work in this form, so please modify it at your own. I think it is all I can do from this level.

Hope it will works.

Greetz,
LetsOWN
Reply
#3

superconfused

enum pInfo
{
Text3D:Tag3D,
VIPTag,
}

Thats how my PlayerInfo enum looks like.

Edit:
All I want is it to work for several players at once not a new code.
It doesnt seem like that is necessary.
Reply
#4

Hm.. I understand it this way:
You want to show this 3DDraw only for some players, not all? Yes?

Greetz,
LetsOWN
Reply
#5

Quote:
Originally Posted by LetsOWN[PL]
Посмотреть сообщение
Hm.. I understand it this way:
You want to show this 3DDraw only for some players, not all? Yes?

Greetz,
LetsOWN
If one VIP Member uses this it showes for him, if another one tried to use it the 3D Draw disappears from the the first VIP member but appears on the second one typing it.
It only works for 1 VIP at the time I want every it to work for more VIPS at the same time.
Reply
#6

How you declared Tag3D ?
pawn Код:
PlayerInfo[playerid][Tag3D]
Reply
#7

What do you mean?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)