26.06.2012, 15:17
hello i created a /glasses cmd but i have a problem "how can i do /glasses to put on glasses and take them off?and with the glasses that i bought, i really need this answer its getting me mad..
PHP код:
if (strcmp("/glasses", cmdtext, true, 10) == 0)
{
//Setglasseid[playerid]
if(PlayerInfo[playerid][pGlasses] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have any glasses!"); // It will check if the character has any glasses in his savelog and if he hasn't it will send him a message.
if(glasses[playerid] == false)
{
SetPlayerHoldingObject(playerid, glasseid, 2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
glasses[playerid] = true;
}
else if(glasses[playerid] == true)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid,1);
glasses[playerid] = false;
}
return 1;
}