/goto /enablegoto /disablegoto +REP
#7

pawn Код:
if(strcmp(cmdtext, "/goto", true) == 0)
    {
        new targetid;
        if(sscanf(cmdtext[6], "u", targetid))//since in strcmp we cannot use params so i added this  cmdtext[6]
        {
            return SendClientMessage(playerid, COLOR_GRAY, "Usage: /goto [playerid]");
        }
        else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid player specified.");
        else if(targetid == playerid) return SendClientMessage(playerid, -1, "You cannot use this command on yourself!");
        else if(gototog[targetid] == 1) return SendClientMessage(playerid, -1, "That player has disabled players from going to them");
        new Float: pos[3];
        GetPlayerPos(targetid, pos[0], pos[1], pos[2]);
        SetPlayerInterior(playerid, GetPlayerInterior(targetid));
        SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
        return 1;
    }

    if(strcmp(cmdtext, "/toggoto", true) == 0)
    {
        if(gototog[playerid] == 0)
        {
            gototog[playerid] = 1;
            SendClientMessage(playerid, -1, "Other players may not teleport to you now!");
        }
        else if(gototog[playerid] == 1)
        {
            gototog[playerid] = 0;
            SendClientMessage(playerid, -1, "Other players may teleport to you now!");
        }
        return 1;
    }
+REP if i helped you.
Reply


Messages In This Thread
/goto /enablegoto /disablegoto +REP - by [SU]Spartan - 14.09.2014, 13:58
Re: /goto /enablegoto /disablegoto +REP - by IceBilizard - 14.09.2014, 14:31
Re: /goto /enablegoto /disablegoto +REP - by Gogeta101 - 14.09.2014, 14:35
Re: /goto /enablegoto /disablegoto +REP - by [SU]Spartan - 14.09.2014, 15:11
Re: /goto /enablegoto /disablegoto +REP - by Abagail - 14.09.2014, 15:16
Re: /goto /enablegoto /disablegoto +REP - by Affan - 14.09.2014, 15:18
Re: /goto /enablegoto /disablegoto +REP - by Ricagor - 14.09.2014, 15:23

Forum Jump:


Users browsing this thread: 1 Guest(s)