Same Command !
#1

Hey guys sup ?

I want to learn how can I do a command twice..

For increas:

I want to enter some place with /blo and when I want to exit the place I will do the same command.
Reply
#2

You may use if and else statements in this case.

pawn Код:
if (strcmp("/blo", cmdtext, true, 10) == 0)
    {
        if(condition)
        {
            //...
        }
        else
        {
            //...
        }
    }
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#3

pawn Код:
CMD:blo(playerid, params[])
{
    if(GetPVarInt(playerid, "blo") == 0) {
        SetPlayerPos(playerid,Float:x,Float:y,Float:z);
        SetPlayerInterior(playerid,interiorid);
        SetPVarInt(playerid, "blo", 1);
    }
    else if(GetPVarInt(playerid, "blo") == 1) {
        SetPlayerPos(playerid,Float:x,Float:y,Float:z);
        SetPlayerInterior(playerid,interiorid);
        SetPVarInt(playerid, "blo", 0);
    }
    return 1;
}
However, about the InteriorIDs that the place you enter has.
Or use the /interior command ingame, and it will show you the ID
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)