Goto Enable and Disable
#3

Oh my god.
1) Use [ pawn ] tags.
2) Use zcmd and sscanf
3) Why 128 for "On"? Why?
4) Why 128 for "Off"?

pawn Код:
new bool: gotoState[ MAX_PLAYERS ] = {false, ...};
CMD:goto(playerid, params[])
{
    new target;
    if(!sscanf(params, "u", target)) {
        if(gotoState[target]) {
            new Float: x, Float: y, Float: z;
            GetPlayerPos(target, x, y, z);
            SetPlayerPos(playerid, x, y, z);
        }
        else return SendClientMessage(playerid,COLOR_RED,"Il giocatore ha disattivato il goton");
      }
      else return SendClientMessage(playerid, COLOR_RED, "USAGE: /goto [playerid]");
      return 1;
}

CMD:mygoto(playerid, params[])
{
    gotoState[playerid] = !gotoState[playerid];
    return 1;
}
Reply


Messages In This Thread
Goto Enable and Disable - by SuperDJ - 10.09.2014, 17:42
Re: Goto Enable and Disable - by dusk - 10.09.2014, 17:46
Re: Goto Enable and Disable - by [XST]O_x - 10.09.2014, 17:48
Re: Goto Enable and Disable - by SuperDJ - 10.09.2014, 17:50
Re: Goto Enable and Disable - by SuperDJ - 10.09.2014, 17:56
Re: Goto Enable and Disable - by SuperDJ - 10.09.2014, 18:29

Forum Jump:


Users browsing this thread: 2 Guest(s)