SA-MP Forums Archive
one command give me errors - 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: one command give me errors (/showthread.php?tid=264417)



one command give me errors - boyan96 - 26.06.2011

PHP код:
if(strcmp(cmd"/holdoff",true)==0)
{
        if ( 
IsPlayerAttachedObject(playerid, )
        {
            
RemovePlayerAttachedObject(playerid,);
        }
    } 
C:\Documents and Settings\Desktop\gangwars.pwn(6405) : error 017: undefined symbol "IsPlayerAttachedObject"
C:\Documents and Settings\Desktop\gangwars.pwn(6407) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Desktop\gangwars.pwn(6407) : error 035: argument type mismatch (argument 2)


Re: one command give me errors - [HiC]TheKiller - 26.06.2011

IsPlayerAttachedObject isn't a default sa-mp function. The error is because you have no defined it anywhere. I think you where needing SetPlayerAttachedObject. The other error is because you have a comma but you have no value after it. Look at the wiki page for RemovePlayerAttachedObject


Re: one command give me errors - iPLEOMAX - 26.06.2011

You don't need IsPlayerAttachedObject.

Just you have to know the index where you attached the object before.

Change:
pawn Код:
if(strcmp(cmd, "/holdoff",true)==0)
{
        if ( IsPlayerAttachedObject(playerid, )
        {
            RemovePlayerAttachedObject(playerid,);
        }
}
To:
pawn Код:
if(strcmp(cmd, "/holdoff",true)==0)
{
            RemovePlayerAttachedObject(playerid,0);
            return true;
}
RemovePlayerAttachedObject(playerid, <index>);


Re: one command give me errors - Skaizo - 26.06.2011

Код:
if(strcmp(cmd, "/holdoff",true)==0)
{
    RemovePlayerAttachedObject(playerid,0);
    return 1;
}
https://sampwiki.blast.hk/wiki/RemovePlayerAttachedObject