dcmd_goto(playerid, params[])
{
if(UserStats[playerid][Admin] >= 2)
{
new id;
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, RTNUSRNoResults); // ID is not connected, send an error message ====>Error Line
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "Admin Usage: /Goto (id/name)");
else
{
new string[128];
new Float: x, Float: y, Float: z,Float:a;
GetPlayerPos(id,x,y,z);
GetPlayerFacingAngle(id, a);
new interior = GetPlayerInterior(id);
new name[24];
GetPlayerName(id, name, 24);
if(IsPlayerNPC(id))
{
if(!strcmp(name,"[BOT]Pendelbury",true)) { interior = 3; }
if(!strcmp(name,"[BOT]Felix",true)) { interior = 3; }
}
new vworld = GetPlayerVirtualWorld(id);
SetPlayerPos(playerid, x+2,y,z);
SetPlayerFacingAngle(playerid, a);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid,interior);
SetPlayerVirtualWorld(playerid,vworld);
UserStats[playerid][InHouseID] = UserStats[id][InHouseID];
format(string, sizeof(string), "*{F6A4D5}ADMIN INFO: {FFFFFF}You Teleported To {F6A4D5}%s(%d)", UserStats[id][Name], id);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
else return SendClientMessage(playerid, COLOR_RED, "Looks like you forgot the commands! Use /commands for a list of commands.");
return 1;
}
dcmd_goto(playerid, params[])
{
if(UserStats[playerid][Admin] >= 2)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "Admin Usage: /Goto (id/name)");
new id;
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, RTNUSRNoResults);
new string[128];
new Float: x, Float: y, Float: z,Float:a;
GetPlayerPos(id,x,y,z);
GetPlayerFacingAngle(id, a);
new interior = GetPlayerInterior(id);
new name[24];
GetPlayerName(id, name, 24);
if(IsPlayerNPC(id))
{
if(!strcmp(name,"[BOT]Pendelbury",true)) { interior = 3; }
if(!strcmp(name,"[BOT]Felix",true)) { interior = 3; }
}
new vworld = GetPlayerVirtualWorld(id);
SetPlayerPos(playerid, x+2,y,z);
SetPlayerFacingAngle(playerid, a);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid,interior);
SetPlayerVirtualWorld(playerid,vworld);
UserStats[playerid][InHouseID] = UserStats[id][InHouseID];
format(string, sizeof(string), "*{F6A4D5}ADMIN INFO: {FFFFFF}You Teleported To {F6A4D5}%s(%d)", UserStats[id][Name], id);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else return SendClientMessage(playerid, COLOR_RED, "Looks like you forgot the commands! Use /commands for a list of commands.");
return 1;
}
dcmd_goto(playerid, params[]) { if(UserStats[playerid][Admin] >= 2) { new id; if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "Admin Usage: /Goto (id/name)"); if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, RTNUSRNoResults);
Can you please read next time, I put it in my previous post. |