#1

can you help me how to make teleports?
like /race
thank you very much if u help!
Reply
#2

a teleport is easy
all it is is command basic and setplayerpos

but thats a basic one like gotols

For others you will need to get the x,y,z and bit then tell it togoto the x,y,z you just got
Reply
#3

but i want to do when i do /race
i will teleport the x y z that i enterd can u give me a tut?
Reply
#4

If you want only On Foot:
pawn Code:
if (strcmp(cmdtext, "/race", true) == 0) {
        RemovePlayerFromVehicle(playerid);
        SetPlayerPos(playerid,x,y,z);
        GameTextForPlayer(playerid,"Welcome to race!",4000,6);
        return 1;
    }
If else On Vehicle:
pawn Code:
if (!strcmp(cmdtext, "/race", true)) {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(GOTOPLAYER,x,y,z);
        if (GetPlayerState(playerid)==PLAYER_STATE_DRIVER)SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
        else SetPlayerPos(playerid,x,y,z);
        return 1;
    }
Reply
#5

thanks!
Reply
#6

rep+
Reply
#7

Thanks and Your Welcome!
Reply
#8

where do i put that? in onplayertextcommand?
im building a new mod from 0
Reply
#9

If you are not using ZCMD/DCMD then yes OnPlayerCommandText.

pawn Code:
if (!strcmp(cmdtext, "/race", true))
  {
    new Float: x, Float: y, Float: z;
       
    GetPlayerPos(GOTOPLAYER, x, y, z);
       
    if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z); }
    else { SetPlayerPos(playerid, x, y, z); }
    return 1;
    }
GETPLAYERPOS would be the ID of the player you want to warp them to. If this is not the case, set the x, y and z values to where you want them to warp in place of GetPlayerPos.
Reply
#10

If you want it with ZCMD this is the Code.
pawn Code:
CMD:race(playerid, params[])
{
     new Float: x, Float: y, Float: z;
     GetPlayerPos(GOTOPLAYER, x, y, z);

     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER_
     {
          SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);    
     }
     else
     {
          SetPlayerPos(playerid, x, y, z);
     }
           
     return 1;
}
Reply
#11

C:\Documents and Settings\\Desktop\hot frap backup\HotFrapNewServerScriptByNinjaa.pwn(235) : error 001: expected token: "-identifier-", but found "-rational value-"
C:\Documents and Settings\\Desktop\hot frap backup\HotFrapNewServerScriptByNinjaa.pwn(237) : error 017: undefined symbol "GOTOPLAYER"
C:\Documents and Settings\\Desktop\hot frap backup\HotFrapNewServerScriptByNinjaa.pwn(239) : warning 202: number of arguments does not match definition
C:\Documents and Settings\\Desktop\hot frap backup\HotFrapNewServerScriptByNinjaa.pwn(240) : error 017: undefined symbol "x"
C:\Documents and Settings\\Desktop\hot frap backup\HotFrapNewServerScriptByNinjaa.pwn(243) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
what is it mean?
thats what i did
if (!strcmp(cmdtext, "/race", true))
{
new Float:2057.3955, Float:861.6058, Float:6.7143,181;

GetPlayerPos(GOTOPLAYER, x, y, z);

if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { SetVehiclePos(GetPlayerVehicleID(playerid), 2057.3955, 861.6058, 6.7143,181); }
else { SetPlayerPos(playerid, x, y, z); }
return 1;
}
i rily need help!
Reply
#12

First, use [pawn] for the script.
At the top
pawn Code:
new GOTOPLAYER;
And at the
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/race", true)) {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(GOTOPLAYER,x,y,z);
        if (GetPlayerState(playerid)==PLAYER_STATE_DRIVER)SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
        else SetPlayerPos(playerid,x,y,z);
        ResetPlayerWeapons(playerid);
        return 1;
    }
//More
==============================================
EDIT:
Here is your mistake


Quote:
Originally Posted by noder51
View Post
pawn Code:
new Float:2057.3955, Float:861.6058, Float:6.7143,181;

GetPlayerPos(GOTOPLAYER, x, y, z);
You need to have them
pawn Code:
new Float:x, Float:y, Float:z;
And here your coordinates
pawn Code:
GetPlayerPos(GOTOPLAYER, 2057.3955, 861.6058, 6.7143,181);
Reply
#13

pawn Code:
if(!strcmp(cmdtext, "//race", true)){
   if(!IsPlayerInAnyVehicle(playerid)){
       SetPlayerPos(playerid, 0.0, 0.0, 0.0);
       SetPlayerFacingAngle(playerid, 0.0);
       SetPlayerInterior(playerid, 0);
       SetPlayerVirtualWorld(playerid, 0);
   }
   else{
       new veh = GetPlayerVehicleID(playerid);
       SetVehiclePos(veh, 0.0, 0.0, 0.0);
       SetVehicleZAngle(veh, 0.0);
       LinkVehicleToInterior(veh, 0);
       SetVehicleVirtualWorld(veh, 0);
       PutPlayerInVehicle(playerid, veh, 0);
   }
   return 1;
}
without car
pawn Code:
if(!strcmp(cmdtext, "//tp", true)){
   SetPlayerPos(playerid, 0.0, 0.0, 0.0);//Change the Cords
   SetPlayerFacingAngle(playerid, 0.0);
   SetPlayerInterior(playerid, 0);
   SetPlayerVirtualWorld(playerid, 0);
   return 1;
}
Rep me if it helped

Edit the X,Y,Z cords
Not Tested
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)