if(!strcmp("/ochelari",cmd,true))
{
tmp = strtok(cmdtext, idx);
skin = GetPlayerSkin(playerid);
id = strval(tmp);
if(!id || id > 33) return SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Correct: /ochelari [1-33]");
TextDrawShowForPlayer(playerid, MsgBox);
SetTimerEx("Hide", 3500, false, "d", playerid);
if(id > 30) goto PutPoliceGlasses;
else
{
id--;
glasseid = CommonRed + id;
SetPlayerHoldingObject(playerid, glasseid, 2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
return 1;
}
PutPoliceGlasses:
glasseid = CopGlassesBlack + (id - 31);
SetPlayerHoldingObject(playerid, glasseid, 2, SkinOffSet[skin][0], floatadd(SkinOffSet[skin][1], 0.004500), SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
return 1;
}
if (strcmp("/glasses", cmdtext, true, 10) == 0)
{
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;
}
if(glasses[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You cannot hold more than a pair of glasses");
{
Use IsPlayerInRangeOfPoint to use the command just in stores, and when you buy some glasses just remove some money with GivePlayerMoney.
PD: amazing signature. -.- (Scared me...) |