05.01.2013, 15:10
When I compile the script I receive and error saying:
Here is the code:
Код:
cmd_mask should return a value
PHP код:
CMD:mask(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!PlayerInfo[playerid][pMask] == 1) return SendClientMessage(playerid, COLOR_GREY, "You need to buy a mask from a 24/7!.");
if(PlayerInfo[playerid][pMasked] == 0)
{
PlayerInfo[playerid][pMasked] = 1;
SetPlayerAttachedObject(playerid, 9, 19037, 2, 10, 4.7, 0.0, 90, 90, 0);//You can change this however you want, use sa-mp wiki for more info, right now is HockeyMask2
SendClientMessage(playerid, COLOR_WHITE, "You have put on a mask! (/mask to romove it)");
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 0); // ShowPlayerNameTagForPlayer(i, playerid, 0) hide name for all players
}
}
else
{
PlayerInfo[playerid][pMasked] = 0;
SendClientMessage(playerid, COLOR_WHITE, "You have removed your mask!"); // This is message what was send when you remove your mask
if(IsPlayerAttachedObjectSlotUsed(playerid, 9))
{
RemovePlayerAttachedObject(playerid, 9);
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 1); // ShowPlayerNameTagForPlayer(i, playerid, 1) show name back.
}
}
return 1;
}
}
}