SA-MP Forums Archive
HoldObject - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: HoldObject (/showthread.php?tid=243893)



HoldObject - Typhome - 25.03.2011

////////


Re: HoldObject - Sascha - 25.03.2011

pawn Код:
if(strcmp(cmd, "/prillid", true) == 0)
    {
        if(PData[playerid][rprillid] != 0) {
            if(xrprillidx[playerid] == 0) {
                prilliobjekt[playerid] = SetPlayerAttachedObject(playerid, 2, PData[playerid][rprillid], 2, 0.09, 0.04, 0, 88, 75, 0);
                xrprillidx[playerid] = 1;
            }
            else if(xrprillidx[playerid] == 1) {
                RemovePlayerAttachedObject(playerid,prilliobjekt[playerid]);
                xrprillidx[playerid] = 0;
            }
        } else {
            Kiri(playerid, VALGE, "Sul ei ole prillid ostetud!");
        }
        return 1;
    }



AW: HoldObject - Pablo Borsellino - 25.03.2011

@Sascha: No, your syntax is wrong.
pawn Код:
RemovePlayerAttachedObject(playerid,index);



Re: HoldObject - Typhome - 25.03.2011

// Nvm it works.


Re: AW: HoldObject - Sascha - 25.03.2011

Quote:
Originally Posted by Pablo Borsellino
Посмотреть сообщение
@Sascha: No, your syntax is wrong.
pawn Код:
RemovePlayerAttachedObject(playerid,index);
well yea, I wasn't familar with that function hehe..
however the "else" was missing, too... if he is using "if" and later again "if" and checking for a variable that he is changing in the first if statement at the second one, it won't work how it should, neither... :P