need help with /pgoto and /tele commands. -
mittukuttan - 04.02.2013
/pgoto allows to goto other players.only if the tele is on./tele will switch on tele on/off
with sscanf+zcmd plz.
Re: need help with /pgoto and /tele commands. -
Faisal_khan - 04.02.2013
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.
Re: need help with /pgoto and /tele commands. -
mittukuttan - 04.02.2013
plssssss help me iam a poor guy
Re: need help with /pgoto and /tele commands. -
Faisal_khan - 05.02.2013
I said post it here!
https://sampforum.blast.hk/showthread.php?tid=187229
Re: need help with /pgoto and /tele commands. -
Ballu Miaa - 05.02.2013
Haha faisal help him this time but make sure mittukuttan you post it at the right section next time.
Re: need help with /pgoto and /tele commands. -
Faisal_khan - 05.02.2013
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;
}
Re: need help with /pgoto and /tele commands. -
mittukuttan - 14.02.2013
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.
Re: need help with /pgoto and /tele commands. -
sscarface - 14.02.2013
PHP код:
CMD:teleportto(playerid, params[])
{
if( !IsPlayerAdmin( playerid ))
return SendClientMessage( playerid, 0xFF0000FF, "[ERROR] Only RCON admins can use this command." );
if( isnull( params ))
return SendClientMessage( playerid, 0xFFFF00FF, "[USAGE] /teleport [target id] - teleports you to the player." );
new
iTarget = strval( params ),
Float: fPos[ 3 ]
;
GetPlayerPos( iTarget, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
SetPlayerPos( playerid, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
SendClientMessage( playerid, 0x00FF00FF, "[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[1] == 0))
#endif
there is not on/off system but u can teleport to player.
Re: need help with /pgoto and /tele commands. -
Faisal_khan - 15.02.2013
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;
}
Re: need help with /pgoto and /tele commands. -
mittukuttan - 15.02.2013
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.