Glasses - Small Question
#1

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"cmdtexttrue10) == 0)
                    {
                        
//Setglasseid[playerid]
                        
if(PlayerInfo[playerid][pGlasses] == 0) return SendClientMessage(playeridCOLOR_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(playeridglasseid2SkinOffSet[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(playerid1)) RemovePlayerAttachedObject(playerid,1);
                             
glasses[playerid] = false;
                        }
                        return 
1;
                    } 
Reply
#2

pawn Код:
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;
                    }
Also, click here for more info.
Reply
#3

Quote:
Originally Posted by Grand_Micha
Посмотреть сообщение
pawn Код:
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;
                    }
Also, click here for more info.
PHP код:
SetPlayerAttachedObject(playerid2glasseidSkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]); === Tag mismatch
Reply
#4

pawn Код:
SetPlayerAttachedObject(playerid, 2, glasseid,2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
Oopsydaisy, my bad.
Reply
#5

doesent work no errors just no work..
Reply
#6

Then your offsets are obviously wrong. Also, check "glasseid."
Reply
#7

HERE:

pawn Код:
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;
                    }
PHP код:
Oncommandtext:  new glasseidskinid
Reply
#8

I don't want to see that non-English RP bullshit. Use my damn code. Keep in mind that you use PlayerToPoint.
Reply
#9

Micha /buyochleari is with!

PHP код:
if (strcmp("/glasses"cmdtexttrue10) == 0)
                    {
                        
//Setglasseid[playerid]
                        
if(PlayerInfo[playerid][pGlasses] == 0) return SendClientMessage(playeridCOLOR_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(playerid2glasseid,2SkinOffSet[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(playerid1)) RemovePlayerAttachedObject(playerid,1);
                             
glasses[playerid] = false;
                        }
                        return 
1;
                    } 
Reply
#10

pawn Код:
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;
                    }
And check YOUR OFFSETS.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)