[HELP]Teleport System
#1

pawn Код:
CMD:teleon(playerid,params[])
{
   if(tele[playerid]==1)
   return SendClientMessage(playerid, red, "You've already enabled tele command.Use /teleoff");
   tele[playerid]=1;
   SendClientMessage(playerid, 0xFF0000, "You've enabled tele command.Note that others can teleport to you.");
   return 1;
}

CMD:teleoff(playerid,params[])
{
   if(tele[playerid]==0)
   return SendClientMessage(playerid, red, "Your tele command is already OFF.Use /teleon to enable.");
   tele[playerid]=0;
   SendClientMessage(playerid, red, "Your tele command has been turned off.");
   return 1;
}
I want to make both that in 1 command is that possible ? /tele and is will enable/disable the teleport is that possible ?
-Help Rep rep REP+++
Reply
#2

You want to disable player can use teleport to another player ? or you want to disable players to tp to him ? sorry i can't understand what exactly you want
Reply
#3

Like this?

pawn Код:
CMD:tele(playerid,params[])
{
    if(tele[playerid]==0)
    {
        tele[playerid]=1;
        SendClientMessage(playerid,-1,"Teleporting on");
    }
    else
    {
        tele[playerid]=0;
        SendClientMessage(playerid,-1,"Teleporting off");
    }
    return 1;
}
Reply
#4

return SendClientMessage(playerid, red, "Your tele command is already OFF.Use /teleon to enable."); and what about this ?
Reply
#5

pawn Код:
CMD:tele(playerid, params[])
{
    ShowPlayerDialog(playerid,2332,DIALOG_STYLE_LIST,"Choose your option","Teleport On\nTeleport Off","ok","cancel");
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 2332)
    {
        if(response)
        {
            if(listitem == 0)
            {
                tele[playerid]=1;
                SendClientMessage(playerid, 0xFF0000, "You've enabled tele command.Note that others can teleport to you.");
                return 1;
            }
            if(listitem == 1)
            {
                tele[playerid]=0;
                SendClientMessage(playerid, red, "Your tele command has been turned off.");
                return 1;
            }
    return 1;
}
Also don't forget to define
pawn Код:
new tele[MAX_PLAYERS];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)