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;
}
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!");
if(glasses[playerid] == false)
{
SetPlayerAttachedObject(playerid, 2, glasseid, 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, 2)) RemovePlayerAttachedObject(playerid,2);
glasses[playerid] = false;
}
return 1;
}
pawn Код:
|
SetPlayerAttachedObject(playerid, 2, glasseid, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]); === Tag mismatch!
SetPlayerAttachedObject(playerid, 2, glasseid,2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
if(!strcmp("/buyochelari",cmd,true))
{
if(PlayerToPoint(3.0,playerid,1030.5072,-977.4466,42.9841))
{
tmp = strtok(cmdtext, idx);
skin = GetPlayerSkin(playerid);
id = strval(tmp);
if(!id || id > 33) return SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}/buyochelari [1-33]");
GivePlayerCash(playerid, -100);
//glasseid(playerid) = "the current chosen glass id");
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;
}
else
{
SendClientMessage(playerid, COLOR_RED, " Nu esti la Magazinul de Haine/Ochelari/Sapci! ");
}
return true;
}
Oncommandtext: new glasseid, skin, id;
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)
{
SetPlayerAttachedObject(playerid, 2, 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 (strcmp("/glasses", cmdtext, true, 10) == 0)
{
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)
{
SetPlayerAttachedObject(playerid, 2, 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, 2)) RemovePlayerAttachedObject(playerid,2);
glasses[playerid] = false;
}
return 1;
}