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



Commands. - iGetty - 10.03.2011

Just one question, how could I make /paytoll, available in more than one location, using zcmd, like, I want to make some paytolls, but I don't understand the way to make is, so only one opens at a time, please can some one help?

Thank you.


If it helps, I have this, this is something else:

pawn Код:
command(pdgate, playerid, params[])
{
    #pragma unused params

    if(IsPlayerInRangeOfPoint(playerid, 4.0, 1214.19,300.26,19.98))
    {
        SetObjectRot(gate1, 1.68,26.76,71.03);
        SetObjectPos(gate1, 1214.19,300.26,19.901);
        SetTimer("close2", 5000, 0);
        SendClientMessage(playerid, RED, "Paramedic gate, is closing in 5 seconds.");
        return 1;
    }
    return 0;
}



Respuesta: Commands. - Alex_Obando - 11.03.2011

Код:
command(pdgate, playerid, params[])
{
    #pragma unused params

    if(IsPlayerInRangeOfPoint(playerid, 4.0, 1214.19,300.26,19.98))
    {
        SetObjectRot(gate1, 1.68,26.76,71.03);
        SetObjectPos(gate1, 1214.19,300.26,19.901);
        SetTimer("close2", 5000, 0);
        SendClientMessage(playerid, RED, "Paramedic gate, is closing in 5 seconds.");
        if(GetPlayerMoney(playerid) < 300) return SendClientMessage(playerid, COLOR_RED, "You have insufficient            funds!");
	GivePlayerMoney(playerid, - 300);
        return 1;

    }
    return 0;
}



Re: Commands. - antonio112 - 11.03.2011

If I`m not wrong, this is what you mean:
pawn Код:
command(pdgate, playerid, params[])
{
    #pragma unused params

    if(IsPlayerInRangeOfPoint(playerid, 4.0, 1214.19,300.26,19.98))
    {
        SetObjectRot(gate1, 1.68,26.76,71.03);
        SetObjectPos(gate1, 1214.19,300.26,19.901);
        SetTimer("close2", 5000, 0);
        SendClientMessage(playerid, RED, "Paramedic gate, is closing in 5 seconds.");
        return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 4.0, newx, newy, newz)) // newx, newy, newz - are the other gate coords.
    {
        //bla bla
        return 1;
    }
    return 1;
}
Oh and by the way, don`t use 'return 0;' in commands... use return 1; instead.