How to make teleport command
#1

im search in ****** and on search
i don't find any i only find game modes
i wanna make an admin teleport command how do i do that?
Reply
#2

pawn Код:
if (strcmp("/teleport", cmdtext, true, 10) == 0)
    {
        if(IsPlayerAdmin(playerid))
{
SetPlayerPos(playerid,x,y,z);
SendClientMessage(playerid,0x00FF00FF,"You have been teleported");
        return 1;
    }
return 0;
}
Replace the x,y,z with the co ordinates.
Reply
#3

You got positions ?
What command processor are you using ?
EDIT:
Tigerbeast11, explain him, he wants to learn how to.
Reply
#4

Well, you need to go into debug and save the position of where you want to go. Use /save ingame. Then locate you GTA User Files and find a file name savedpositions.txt. You will need to use the x, y, z coordinates.

It will be something like this:
AddPlayerClass(104,2580.5696,-1491.9326,24.0021,277.8946,0,0,0,0,0,0); //
This is how it is:
AddPlayerClass(classid,x,y,z,facingangle,weapon1,a mmo,weapon2,ammo,weapon3,ammo);

You need the x y z and replace them in the command I gave you. I hope that explains it.
Reply
#5

Tiger where do i put it below? under the other admin commands?
Reply
#6

Yes under the other commands.
Reply
#7

i got this warning:
Код:
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(3304) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#8

What line... ?
Reply
#9

3304

Код:
	SetPlayerPos(playerid,2246.1997,-794.1442,314.2092,3.0406);
Reply
#10

pawn Код:
SetPlayerPos(playerid,2246.1997,-794.1442,314.2092);
Reply
#11

Thanks Darnell enjoy you're 9th Reputation :P
Tiger enjoy you're 1st reputation
Reply
#12

Thanks...you added an angle, the last position, and SetPlayerPos function requires X,Y,Z positions only.
Reply
#13

oh but when now when i go ingame it says unknown command?
Reply
#14

pawn Код:
if (strcmp("/teleport", cmdtext, true, 10) == 0)
{
    if(IsPlayerAdmin(playerid))
    {
        SetPlayerPos(playerid,x,y,z);
        SendClientMessage(playerid,0x00FF00FF,"You have been teleported");
    } else return SendClientMessage(playerid, COLOR HERE, "You need to be admin to use this command");
    return 1;
}
Reply
#15

well, it was nothing wrong with the code tiger gave me well, when i logged in as rcon admin it worked i could tele if im not logged in as rcon admin it dont work.
Reply
#16

This is the version without logging into rcon .
pawn Код:
if (strcmp("/teleport", cmdtext, true, 10) == 0)
{
        SetPlayerPos(playerid,x,y,z);
        SendClientMessage(playerid,0x00FF00FF,"You have been teleported");
    return 1;
}
Reply
#17

damn i think i've taken away somethign but i dont know what

Код:
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2350) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2353) : error 017: undefined symbol "ShowLoginScreen"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2356) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2359) : error 017: undefined symbol "ShowRegisterScreen"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2394) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2395) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2396) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2397) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2398) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2399) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2400) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2401) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2402) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2403) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2404) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2405) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2406) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2407) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2408) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2409) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2413) : error 004: function "ResetVariables" is not implemented
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2422) : error 004: function "RemoveRoadblock" is not implemented
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2445) : error 017: undefined symbol "PlayerName"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2475) : error 017: undefined symbol "PlayerObjectUpdate"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2619) : error 017: undefined symbol "StopLoopingAnim"
C:\Users\james\Documents\SFCRRPG\gamemodes\SFCRRPG.pwn(2625) : error 017: undefined symbol "PlayerName"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#18

Hmm, I don't think that this is a good way to make a teleport command! It will only teleport you there, where the co-ordinates are! So you have to make 1000000 tele commands!

Do you want one, which teleports other players to your position?

TO YOUR ERRORS:

this will fix the most of them:

PHP код:
            stock PlayerName(playerid)
            {
             new 
pName[25];
             
GetPlayerName(playeridpNamesizeof(pName));
             return 
pName;
            } 
Reply
#19

You removed PlayerNam defenition, StopLoopingAnim, PlayerObjectUpdate, ResetVariables, RemoveRoadblock.
Reply
#20

its fixed Darnell you're code worked but when i did /adminarea ingame it said u need to be admin means i need to login on rcon i want that none rcon admins can use it what i mean is that admins who are not logged in on rcon can teleport with /adminarea
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)