SA-MP Forums Archive
Can you solve this ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can you solve this ? (/showthread.php?tid=577895)



Can you solve this ? - xamen - 14.06.2015

I've made this CMD to add a personal status for admins ..
when you use '/astatus text' a text label will be attached on you when using '/astatus off' or '/astatusoff' it will go

THE PROBLEM: When i use '/astatus off' or '/astatusoff' The text label Disappear for all users, and i want it to disappear for playerid only help please...
Код:
new Text3D:aSTATUS[MAX_PLAYERS];

CMD:astatus(playerid, params[]) // 
{
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /astatus [text/off]");
	    if(strcmp(params, "off", true) == 0)
	    {
	        Delete3DTextLabel(aSTATUS[playerid]);
		    SendClientMessageEx(playerid, COLOR_WHITE, "You've Turned Off Your Personal MOTD.");
		    return 1;
	    }
	    aSTATUS[playerid] = Create3DTextLabel(params, 0xFFFFFF, 110.0, 110.0, 110.0, 110.0, 0);
            Attach3DTextLabelToPlayer(aSTATUS[playerid], playerid, 0.0, 0.0, 0.0);

	    SendClientMessageEx(playerid, COLOR_WHITE, "You've Adjusted Your Personal MOTD.");
	}
	return 1;
}

CMD:astatusoff(playerid, params[]) //
{
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        DestroyDynamic3DTextLabel(aSTATUS[playerid]);
        SendClientMessageEx(playerid, COLOR_WHITE, "You've Turned Off Your Personal MOTD.");
    }
	return 1;
}



Re: Can you solve this ? - Dangjai - 14.06.2015

Код:
CMD:astatusoff(playerid, params[]) //
{
    if(PlayerInfo[playerid] >= 0)
    {
        DestroyDynamic3DTextLabel(aSTATUS[playerid]);
        SendClientMessageEx(playerid, COLOR_WHITE, "You've Turned Off Your Personal MOTD.");
    }
	return 1;
}



Re: Can you solve this ? - xamen - 14.06.2015

Quote:
Originally Posted by Kinglee
Посмотреть сообщение
CMD:astatusoff(playerid, params[]) //
{
if(PlayerInfo[playerid] >= 0)
{
DestroyDynamic3DTextLabel(aSTATUS[playerid]);
SendClientMessageEx(playerid, COLOR_WHITE, "You've Turned Off Your Personal MOTD.");
}
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 4)

so if the playerid isn't admin level 4+ he can't use the cmd


Re: Can you solve this ? - Dangjai - 14.06.2015

Yes.


Re: Can you solve this ? - xamen - 14.06.2015

The problem when i use /astatus off the text label will disappear for everyone using /astatus


Re: Can you solve this ? - Dangjai - 14.06.2015

Quote:
Originally Posted by xamen
Посмотреть сообщение
The problem when i use /astatus off the text label will disappear for everyone using /astatus
You used my code? If not try it.


Re: Can you solve this ? - xamen - 14.06.2015

Quote:
Originally Posted by Kinglee
Посмотреть сообщение
You used my code? If not try it.
Not working.


Re: Can you solve this ? - Dangjai - 14.06.2015

Код:
CMD:astatusoff(playerid, params[]) //
{
    if(PlayerInfo[playerid] >=0)
    {
        DestroyDynamic3DTextLabel(aSTATUS[pAdmin]);
        SendClientMessageEx(playerid, COLOR_WHITE, "You've Turned Off Your Personal MOTD.");
    }
	return 1;
}



Re: Can you solve this ? - xamen - 14.06.2015

Quote:
Originally Posted by Kinglee
Посмотреть сообщение
Код:
CMD:astatusoff(playerid, params[]) //
{
    if(PlayerInfo[playerid] >=0)
    {
        DestroyDynamic3DTextLabel(aSTATUS[pAdmin]);
        SendClientMessageEx(playerid, COLOR_WHITE, "You've Turned Off Your Personal MOTD.");
    }
	return 1;
}
Man! are you kidding me ?
Код:
 if(PlayerInfo[playerid] >=0)
Make no Sense



Re: Can you solve this ? - Dangjai - 14.06.2015

I've changed playerid to pAdmin
Код:
        DestroyDynamic3DTextLabel