09.06.2014, 01:06
Introduction
First of all guys, Today i am going to show you how to make a very simple Teleport system (Dialogs).
What's it?
All you have to do is to enter the playerid in the below and He will be teleported to you
Things/Progams that you need
Just sscanf - Click here to download it.
ZCMD - Click here to download
Command Line:
In this step, You need to enter the playerid in the below.
Now OnDialogResponse:
In this step, When you enter the playerid in the below, He will be teleported to you, Take a look at this line:
We defined the players's float, Take a look:
Well I think That's the end , I hope this helped you
First of all guys, Today i am going to show you how to make a very simple Teleport system (Dialogs).
What's it?
All you have to do is to enter the playerid in the below and He will be teleported to you
Things/Progams that you need
Just sscanf - Click here to download it.
ZCMD - Click here to download
Command Line:
pawn Код:
CMD:gethere(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2) //This is for admin rank, You don't need to use it.
{
ShowPlayerDialog(playerid, DIALOG_GETHERE, DIALOG_STYLE_INPUT, "Enter the playerid", "Please make sure the player you wish to teleport to your position is online.\nPlease input the playerid below of the player you wish to teleport.", "Teleport", "Cancel");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
}
return 1;
}
Now OnDialogResponse:
pawn Код:
if(response)
{
new id, Float:x, Float:y, Float:z;
if(id != INVALID_PLAYER_ID)
{
ShowPlayerDialog(playerid, DIALOG_GETHERE, DIALOG_STYLE_INPUT, "Enter the playerID", "You entered a wrong PlayerID\nPlease Enter the playerid that you wish to teleport him to your position.", "Teleport", "Cancel");
}
else
{
if(GetPlayerState(id) == PLAYER_STATE_SPECTATING)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "That person is spectating someone.");
return 1;
}
SetPlayerVirtualWorld(id, PlayerInfo[playerid][pVW]);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(id, x, y+2, z);
if (GetPlayerState(id) == 2)
{
fVehSpeed[id] = 0.0;
new tmpcar = GetPlayerVehicleID(id);
SetVehiclePos(tmpcar, x, y+4, z);
LinkVehicleToInterior(GetPlayerVehicleID(id), GetPlayerInterior(playerid));
SetPlayerInterior(id, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(GetPlayerVehicleID(id), GetPlayerVirtualWorld(playerid));
SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
}
else
{
SetPlayerPos(id,x,y+2, z);
SetPlayerInterior(id, GetPlayerInterior(playerid));
SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
}
}
}
return true;
}
pawn Код:
SetPlayerPos(id,x,y+2, z);
SetPlayerInterior(id, GetPlayerInterior(playerid));
SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
pawn Код:
new id, Float:x, Float:y, Float:z;