SA-MP Forums Archive
Object wont attach to player after i updated to 0.3.7 R2 - 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)
+--- Thread: Object wont attach to player after i updated to 0.3.7 R2 (/showthread.php?tid=613238)



Object wont attach to player after i updated to 0.3.7 R2 - MayaEU - 25.07.2016

The title says it all

pawn Код:
dcmd_carpet(playerid,param[])
{
    #pragma unused param
    if(Carpet[playerid] == -1)
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        Carpet[playerid] = CreateObject(980, x + 0.5, y, z + pOffset[playerid], 0.00, 0.00, 0.00);
        AttachObjectToPlayer( Carpet[playerid], playerid, 0.5, 0.0, pOffset[playerid], 90.0, 0.0, 90.0 );
        SendSystemMessage(playerid,"Magic carpet ride!");
        SendSystemMessage(playerid,"Use /offset to adjust height.");
    } else {
        DestroyObject(Carpet[playerid]);
        Carpet[playerid] = -1;
        SendSystemMessage(playerid,"Carpet removed.");
    }
    return 1;
}