need help with /pgoto and /tele commands.
#1

/pgoto allows to goto other players.only if the tele is on./tele will switch on tele on/off
with sscanf+zcmd plz.
Reply
#2

Ah, you want someone to make this command? If yes, then post it here https://sampforum.blast.hk/showthread.php?tid=187229

If no, then explain your problem.
Reply
#3

plssssss help me iam a poor guy
Reply
#4

I said post it here!
https://sampforum.blast.hk/showthread.php?tid=187229
Reply
#5

Haha faisal help him this time but make sure mittukuttan you post it at the right section next time.
Reply
#6

Have fun!
pawn Код:
new teleon[MAX_PLAYERS]

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/tele", cmdtext, true) == 0)
    {
        if(tele == 0)
        {
            tele = 1;
            SendClientMessage(playerid, -1, "Tele is enabled now");
        }
        else
        {
            tele = 0;
            SendClientMessage(playerid, -1, "Tele is disabled now");
        }
        return 1;
    }
    if (strcmp("/pgoto", cmdtext, true) == 0)
    {
        if(tele == 0)
        {
            SendClientMessage(playerid, -1, "ERROR: Tele is disabled!");
        }
        else
        {
            new tmp[256], player, Float:X, Float:Y, Float:Z, carid, seat;
            tmp = strtok(cmdtext, idx);
            player = strval(tmp);
            GetPlayerPos(player, X, Y, Z);
            if(IsPlayerInAnyVehicle(playerid))
            {
                carid = GetPlayerVehicleID(playerid);
                seat = GetPlayerVehicleSeat(playerid);
                SetVehiclePos(carid, X+1, Y, Z);
                PutPlayerInVehicle(playerid, carid, seat);
                return 1;
            }
            SetPlayerPos(playerid, X+1, Y, Z);
        }
        return 1;
    }
    return 0;
}
Reply
#7

C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(359) : error 001: expected token: ";", but found "public"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(363) : error 017: undefined symbol "tele"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(365) : error 017: undefined symbol "tele"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(365) : warning 215: expression has no effect
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(370) : error 017: undefined symbol "tele"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(370) : warning 215: expression has no effect
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(377) : error 017: undefined symbol "tele"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(384) : error 017: undefined symbol "strtok"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(384) : error 033: array must be indexed (variable "tmp")
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(115 : warning 203: symbol is never used: "teleon"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


7 Errors.
Reply
#8

PHP код:
CMD:teleportto(playeridparams[])
{
    if( !
IsPlayerAdminplayerid ))
        return 
SendClientMessageplayerid0xFF0000FF"[ERROR] Only RCON admins can use this command." );
    if( 
isnullparams ))
        return 
SendClientMessageplayerid0xFFFF00FF"[USAGE] /teleport [target id] - teleports you to the player." );
        
    new
                
iTarget strvalparams ),
        
Float:  fPos]
    ;
        
    
GetPlayerPosiTargetfPos], fPos], fPos] );
    
SetPlayerPosplayeridfPos], fPos], fPos] );
    
SendClientMessageplayerid0x00FF00FF"[SUCCESS] You've been teleported to the specified player" );
    
    return 
true;

PHP код:
//taken from y_utils - a part of the YSI package by ******

#if !defined isnull
    #define isnull(%1) \
        
((%1[0] == 0) || (%1[0] == && %1[1] == 0))
#endif 
there is not on/off system but u can teleport to player.
Reply
#9

pawn Код:
new teleon[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/tele", cmdtext, true) == 0)
    {
        if(tele == 0)
        {
            tele = 1;
            SendClientMessage(playerid, -1, "Tele is enabled now");
        }
        else
        {
            tele = 0;
            SendClientMessage(playerid, -1, "Tele is disabled now");
        }
        return 1;
    }
    if (strcmp("/pgoto", cmdtext, true) == 0)
    {
        if(tele == 0)
        {
            SendClientMessage(playerid, -1, "ERROR: Tele is disabled!");
        }
        else
        {
            new tmp[256], player, Float:X, Float:Y, Float:Z, carid, seat;
            tmp = strtok(cmdtext, idx);
            player = strval(tmp);
            GetPlayerPos(player, X, Y, Z);
            if(IsPlayerInAnyVehicle(playerid))
            {
                carid = GetPlayerVehicleID(playerid);
                seat = GetPlayerVehicleSeat(playerid);
                SetVehiclePos(carid, X+1, Y, Z);
                PutPlayerInVehicle(playerid, carid, seat);
                return 1;
            }
            SetPlayerPos(playerid, X+1, Y, Z);
        }
        return 1;
    }
    return 0;
}
Reply
#10

C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(359) : error 001: expected token: ";", but found "new"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(359) : error 021: symbol already defined: "teleon"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(370) : error 017: undefined symbol "tele"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(372) : error 017: undefined symbol "tele"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(372) : warning 215: expression has no effect
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(377) : error 017: undefined symbol "tele"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(377) : warning 215: expression has no effect
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(384) : error 017: undefined symbol "tele"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(391) : error 017: undefined symbol "strtok"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(391) : error 033: array must be indexed (variable "tmp")
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1165) : warning 203: symbol is never used: "teleon"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)