if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pHelper] >= 4)
CMD:tppos(playerid, params[]) { if(IsPlayerAdmin(playerid)) { new Float:tpx,Float:tpy,Float:tpz,str[150]; if(sscanf(params, "fff",tpx, tpy, tpz)) { SendClientMessage(playerid, -1, "{FF0000}Syntax - {808080}/tppos <x> <y> <z>"); return 1; } SetPlayerPos(playerid, tpx, tpy, tpz+1); format(str,sizeof(str),"{FFFF00}[Info] {808080}You have teleported to the coordinates: {FFFFFF}%f %f %f",tpx,tpy,tpz); SendClientMessage(playerid, -1, str); }else{ SendClientMessage(playerid, -1, "{FF0000}[Error] {808080}You must be an admin to use this command."); } return 1; }
YCMD:gotoco(playerid, params[], help) { if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pHelper] >= 4){ new Float ![]() if(sscanf(params, "fff", x, y, z)) return SendClientMessage(playerid, -1, "USAGE: /gotoco (x/y/z)"); if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z); if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) SetPlayerPos(playerid, x, y, z); } return 1; } |
CMD:gotoco(playerid, params[]) { if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pHelper] >= 4){ new Float ![]() if(sscanf(params, "fff", x, y, z)) return SendClientMessage(playerid, -1, "USAGE: /gotoco (x/y/z)"); if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z); if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) SetPlayerPos(playerid, x, y, z); } return 1; } |
CMD:gotoxyz(playerid,params[]) {
if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pHelper] >= 4)
new Float:x, Float:y, Float:z;
new tmp[128], tmp2[128], tmp3[128];
new string[128], Index; tmp = strtok(params,Index); tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
if(isnull(tmp) || isnull(tmp2) || isnull(tmp3)) return SendClientMessage(playerid,red,"USAGE: /gotoxyz [X],[Y],[Z]");
x = strval(tmp); y = strval(tmp2); z = strval(tmp3);
if(GetPlayerState(playerid) == 2) SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
else SetPlayerPos(playerid,x,y,z);
format(string,sizeof(string),"You have teleported to %f, %f, %f", x,y,z); return SendClientMessage(playerid,blue,string);
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
#include <a_samp>
#include <core>
#include <ChatColor>
#include <Dini>
#include <float>
#include <file>
#include <JunkBuster>
#include <morphinc>
#include <time>
#include <utils>
if(strcmp(cmd, "/gotols", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pHelper] >= 2)
{
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 1529.8082,-1678.8477,13.3828);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid, 1529.8082,-1678.8477,13.3828);
}
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have been teleported to Los Santos");
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "{D02F2F}AdmCmd: %s has been teleported to Los Santos", sendername);
ABroadCast(COLOR_RED,string,1);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not authorized to use that command");
}
}
return 1;
}
Try this one:
pawn Код:
|