28.03.2014, 20:15
Example of teleport Command.
pawn Код:
CMD:goto(playerid,params[])
{
if(pInfo[playerid][pLogged] == 1)
{
if(pInfo[playerid][pAdminLevel] >= 2)
{
new targetid;
if(sscanf(params, "u", targetid)) SendClientMessage(playerid,-1,""chat" /goto [playerid]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");
new Float:x,Float:y,Float:z,inter;
GetPlayerPos(targetid,Float:x,Float:y,Float:z);
inter = GetPlayerInterior(targetid);
SetPlayerPosEx(playerid,Float:x,Float:y,Float:z,inter,0);
}
else {
SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" You do not have the right admin permissions for this command!");
}
}
else if(pInfo[playerid][pLogged] == 0)
{
SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" Nice try u ****"); //replace *** with any word u want xD.
printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid));
Kick(playerid);
}
return 1;
}