30.11.2009, 18:21
Hello, I'm trying to make a system allowing masks for free whenever the player wants to use it. This is the mask script I'm using:
I've come with far:
I appreciate any helpful answers.
pawn Код:
if(strcmp(cmd, "/maskon", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMask] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] You do not have a mask");
return 1;
}
if(PlayerInfo[playerid][pLevel] < 5)
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the required level to use this command");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
PlayerInfo[playerid][pMaskuse] = 1;
SendClientMessage(playerid, COLOR_WHITE, "[Info:] You have put your mask on");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s puts a mask on", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/dmask", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMask] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] You do not have a mask");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
PlayerInfo[playerid][pMaskuse] = 1;
SendClientMessage(playerid, COLOR_WHITE, "[Info:] You have put your mask on");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s puts a mask on", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}