CMD:goto(playerid, params[]) { new ID;//creates a new something idk what we call it :P but it is defined later on or used in something this 1 is used in next line if(sscanf(params, "u", ID)) SendClientMessage(playerid, 0xFF0000FF, "USAGE: /goto [id]");//checks if you have written something after /goto if no it sends error else if(!IsPlayerConnected(id) || id == playerid) return SendClientMessage(playerid, 0xFF0000FF, "This player is offline or it is yourself");//checks if the player you are teleporting to is connected or if it is yourself if yes then comes an error else//ELSE what will happen if no errors { new Float, Float:y, Float:z;//creates new floats GetPlayerPos(ID, x, y, z);//gets the player id(which we have entered after /goto position and like saves them into x,y,z defined above as floats SetPlayerPos(playerid, x+1, y+1, z);//sets the player position the id of that player +1 in x +1 in y and z remains same as it defines height } return 1; } |
CMD:goto(playerid, params[])
{
new id, Float:X,Float:Y,Float:Z;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /goto <playerid/name>");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "The player is offline");
new Interior = GetPlayerInterior(id);
SetPlayerInterior(playerid,Interior);
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
GetPlayerPos(id,X,Y,Z);
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), X+ 1, Y+ 1, Z);
LinkVehicleToInterior(GetPlayerVehicleID(playerid),Interior);
}
else SetPlayerPos(playerid, X+ 1,Y+ 1, Z);
return 1;
}
CMD:parkour1(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
}
SetPlayerPos(playerid, X CORDINATE, Y CORDINATE, Z CORDINATE);
return 1;
}
pawn Код:
|
Thank you Affan for parkour teleport codes!
Bro!! i dnt need any /goto command .. i said i need a teleport command it means /sf /lvair /lsair etc like this .. not player teleport |
YCMD:goto(playerid, params[], help)
{
* * if(help)
* * {
* * * * SendClientMessage(playerid, -1, "SF | LS | LV");
* * * * SendClientMessage(playerid, -1, "/goto [Location");
* * }
* * switch ( YHash( params ), false ) //parameter | YHash(str[], bool:sensitive = true, e_HASH_TYPE:type = bernstein);
* * {
* * * * case _H<LS>:
* * * * {
* * * * * * //ls coordinates.
* * * * }
* * * * case _H<LV>:
* * * * {
* * * * * * //lv coordinates.
* * * * }
* * * * case _H<SF>:
* * * * {
* * * * * * //sf coordinates.
* * * * }
* * }
* * return 1;
}
CMD:lvair(playerid, params[]) { new id, Float:X,Float:Y,Float:Z; new Interior = GetPlayerInterior(id); if(IsPlayerInAnyVehicle(playerid)) { SetVehiclePos(GetPlayerVehicleID(playerid), 1509.1740,1811.2737,10.3846); LinkVehicleToInterior(GetPlayerVehicleID(playerid),Interior); } else SetPlayerPos(playerid, 1537.9845,1839.4662,10.9263); return 1; }