В начало ко всем new:
Code
new shapka[MAX_PLAYERS];
В public OnPlayerCommandText:
Code
if(strcmp(cmd, "/shapka", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(shapka[playerid] == 0)
{
SetPlayerAttachedObject(playerid,2, 19064, 2, 0.13, 0.0, 0.0, 0.0, 80.0, 80.0);
shapka[playerid] = 1;
GivePlayerMoneyH(playerid, -1500);
SendClientMessage(playerid, COLOR_YELLOW, " Вы купили новогоднюю шапку!");
}
else
{
RemovePlayerAttachedObject(playerid, 2);
DestroyPlayerObject(playerid, 19064);
shapka[playerid] = 0;
SendClientMessage(playerid, COLOR_YELLOW, " Вы сняли шапку!");
}
}
return 1;
}
Автор: kiruxa125