[HELP]/mask command not working properly -
Lilcuete - 27.12.2009
Well when i do /mask it is suppose to turn on mask ok dat works but if i have the mask on and i do /mask it is suppose to take off the mask but it doesnt heres my command
Код:
if(strcmp(cmd, "/mask", true) == 0) // by LordMan
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMask] < 0)
{
SendClientMessage(playerid, COLOR_GRAD1, " You must be level 5.");
return 1;
}
if(PlayerInfo[playerid][pLevel] < 5)
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not able to use it.");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
format(string, sizeof(string), "~p~You have put your mask on");
GameTextForPlayer(playerid, string, 4000, 3);
PlayerInfo[playerid][pMaskuse] = 1;
OnPropUpdate();
return 1;
}
else if(PlayerInfo[playerid][pMaskuse] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
}
}
format(string, sizeof(string), "~p~You have tooken off the mask");
GameTextForPlayer(playerid, string, 4000, 3);
PlayerInfo[playerid][pMaskuse] = 0;
OnPropUpdate();
}
return 1;
}
Please help thanks
Re: [HELP]/mask command not working properly -
FoxtrotZulu - 27.12.2009
I may be acting stupid here, but I think you've said:
Код:
if(strcmp(cmd, "/mask", true) == 0)
// bla bla bla
else if(PlayerInfo[playerid][pMaskuse] == 1)
// bla bla bla
In short, I think you've misplaced your '
else if'. Good luck.
- Foxtrot
Re: [HELP]/mask command not working properly -
Lilcuete - 27.12.2009
Lol dat doesnt help either
Re: [HELP]/mask command not working properly -
FoxtrotZulu - 27.12.2009
Oh, well sorry for trying help.
Re: [HELP]/mask command not working properly -
Lilcuete - 27.12.2009
?
Re: [HELP]/mask command not working properly -
Lilcuete - 27.12.2009
OMG SOMEONE REPLY
Re: [HELP]/mask command not working properly -
Rensieboy14 - 27.12.2009
Maybe this will help
Код:
new sendername[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
if(strcmp(cmdtext, "/maskoff", true) == 0)
{
if(!strfind(playername, "[Hitman]", true))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
}
}
SendClientMessage(playerid, COLOR_WHITE, "You have put your mask off [/maskon to put it on].");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s puts his mask away.", sendername);
SendClientMessageToAll(COLOR_WHITE, string);
}
}
if(strcmp(cmdtext, "/maskon", true) == 0)
{
if(!strfind(playername, "[Hitman]", true))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
SetPlayerColor(playerid, COLOR_WHITE);
SetPlayerMarkerForPlayer( 42, 1, 0xFFFFFF00 );
}
}
SendClientMessage(playerid, COLOR_WHITE, " You have put your mask on [/maskoff to put it away].");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s puts his mask on.", sendername);
}
}
Re: [HELP]/mask command not working properly -
Lilcuete - 27.12.2009
Lol dats not what i mean i mean if i do /mask and i have the mask on i want to do /mask again to take of the mask but when i do /mask i have the mask on and i do /mask again it still if on me
Re: [HELP]/mask command not working properly -
Gamer_Z - 27.12.2009
if(PlayerInfo[playerid][pMask] < 0)
to
if(PlayerInfo[playerid][pMaskuse] == 0)
btw i think 75% of the command is wrong...
Re: [HELP]/mask command not working properly -
Lilcuete - 27.12.2009
Nope didnt work still