EditObject.
#1

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

Wouldn't it be so?

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

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.
Reply
#4

I agree MP2, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)