SA-MP Forums Archive
EditObject. - 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: EditObject. (/showthread.php?tid=355983)



EditObject. - iGetty - 02.07.2012

When I do this command:


pawn Код:
command(spikestr, playerid, params[])
{
    Spikes++;
    if(SO[0] == 0)
    {
        new Float:x, Float:y, Float:z, Float:a;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, a);
        SO[0] = CreateObject(2899, x, y, z-0.8, 0, 0, 10.0);
    }
    else return SendClientMessage(playerid, -1, "No.");
    return 1;
}
Then try use this command:

pawn Код:
command(select, playerid, params[])
{
    SelectObject(playerid);
    return 1;
}
It doesn't allow me to select the spike strip?


Re: EditObject. - WagnerPM - 02.07.2012

Wouldn't it be so?

pawn Код:
command(select, playerid, params[])
{
    if(!Spikes[playerid])
        return 1;
       
    Spikes[playerid]--;
    SelectObject(playerid);
    return 1;
}



Re: EditObject. - MP2 - 02.07.2012

The object doesn't have collision (it's not solid (you can drive/walk through it)). Collision is used for SelectObject. You'll have to provide the ID directly to EditObject - why not make it edit the closest spike strip to the player? Seems good enough.


Re: EditObject. - iGetty - 02.07.2012

I agree MP2, thanks!