one command give me errors
#1

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)
Reply
#2

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
Reply
#3

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>);
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)