08.02.2016, 12:02
PHP код:
CMD:gotoid(playerid, params[])
{
new giveplayerid;
if(sscanf(params, "u", giveplayerid))
return SendClientMessage(playerid, COLOR_WHITE, "Perdorimi: /gotoid [playerid/partofname]");
new Float:plocx,Float:plocy,Float:plocz;
if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid,COLOR_WHITE, "Ju nuk jeni nл detyrл si admin. Per te pasur akses kete komande duhet te jesh ne detyre. Shkrauj /aduty per te dal ne detyre..");
return 1;
}
if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING)
{
SendClientMessage(playerid, COLOR_GRAD2, "That player is spectating someone.");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
SendClientMessage(playerid, COLOR_GRAD2, "You can't do this while spectating.");
return 1;
}
GetPlayerPos(giveplayerid, plocx, plocy, plocz);
Streamer_UpdateEx(playerid, plocx, plocy, plocz);
if(GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
fVehSpeed[playerid] = 0.0;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
new giveplayeridvw = GetPlayerVirtualWorld(giveplayerid);
new giveplayerint = GetPlayerInterior(giveplayerid);
PlayerInfo[playerid][pVW] = giveplayeridvw;
PlayerInfo[playerid][pInt] = giveplayerint;
SendClientMessage(playerid, COLOR_WHITE, "Ti u teleportove!");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Ti nuk je i autorizuar ta perdoresh kete Komande!");
}
}
else SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
return 1;
}