28.09.2010, 10:36
It's also very simple... If you are using pInfo's you can do it like this.
And Mask code should look like this
PHP код:
if (strcmp("/buymask", cmdtext, true) == 0)
{
if(IsPlayerConnected(playerid))
{
SetPlayerMoney(playerid, -45);
PlayerInfo[playerid][pHasMask] = 1;
SendClientMessage(playerid, COLOR_RED, "You bought a mask! [/maskoff or /mask]");
}
}
PHP код:
if (strcmp("/mask", cmdtext, true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[playerid][pHasMask] == 1)
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
GameTextForPlayer(playerid, "~W~You have put mask ~g~ on", 5000, 5);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You don't have mask!");
}
}
return 1;
}