Command mask bugged [help pleasee] - 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: Command mask bugged [help pleasee] (
/showthread.php?tid=602343)
Command mask bugged [help pleasee] -
ThatFag - 05.03.2016
hey guys.
i got an command mask which allows player to put off their name and avoid name taging and shits like this but the problem is that when player writes example /maks then types anything that contains alot of number/letters like /mask aisofhasfoihaskofhasfkh - and he types it like 5-6 times then other commands wont work for anyone. i dont know what causes this problem btw maybe you may help me out
Код:
COMMAND:mask(playerid, params[])
{
if(PlayerInfo[playerid][admin] || PlayerInfo[playerid][premiumgold] || PlayerInfo[playerid][playerfaction]==FBI || PlayerInfo[playerid][playerlvl]>= 15)
{
new tmp[3];
if(sscanf(params, "s", tmp)) return SCP(playerid, "[on/off]");
if(strcmp(tmp,"on",true)==0)
{
PlayerTemp[playerid][mask]=0;
GameTextForPlayer(playerid,"~g~mask On",1000,1);
PlayerLoop(i) ShowPlayerNameTagForPlayer(i,playerid,1);
RemovePlayerAttachedObject(playerid, 9);
}
else if(strcmp(tmp,"off",true)==0)
{
PlayerTemp[playerid][mask]=1;
GameTextForPlayer(playerid,"~r~mask Off",1000,1);
SetPlayerAttachedObject(playerid,9,19036,2,0.093999,0.026000,-0.004999,93.800018,82.199951,-3.300001,1.098000,1.139999,1.173000);
PlayerLoop(i)
{
if(!PlayerInfo[i][admin])
{
ShowPlayerNameTagForPlayer(i,playerid,0);
}
if(PlayerInfo[playerid][playerteam] != CIV)
{
if(PlayerInfo[playerid][playerteam] == PlayerInfo[i][playerteam])
{
ShowPlayerNameTagForPlayer(i,playerid,0);
}
}
}
}
else return SCP(playerid, "[on/off]");
}
else return SendClientError(playerid, CANT_USE_CMD);
return 1;
}
Re: Command mask bugged [help pleasee] -
iKevin - 05.03.2016
Код:
//add pMasked and pMask to your enum pInfo
COMMAND:mask(playerid, var[])
{
new string[128];
if(!Logged(playerid)) return NoLogin(playerid);
if(PlayerInfo[playerid][admin] || PlayerInfo[playerid][premiumgold] || PlayerInfo[playerid][playerfaction]==FBI || PlayerInfo[playerid][playerlvl]>= 15)
{
Player[playerid][pMasked] = 1;
format(string, sizeof(string), "* %s has put his mask on his face.", GetName(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, false);
}
}
else
{
Player[playerid][pMasked] = 0;
format(string, sizeof(string), "* Stranger has removed the mask from his face.");
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, true);
}
}
return 1;
}
I've completely wiped it and re-made it. Hope it's okay.
give me some rep m8