29.08.2011, 10:01
pawn Код:
if(strcmp(cmd, "/gethere", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gethere [Playerid/PartOfName]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (PlayerInfo[plo][pAdmin] > 1337)
{
SendClientMessage(playerid, COLOR_GRAD1, "Ask the admin to goto you.");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 4)
{
FEvent[plo] == FEvent[playerid];//Like this??
GetPlayerPos(playerid, plocx, plocy, plocz);
SetPlayerVirtualWorld(plo, GetPlayerVirtualWorld(playerid));
SetPlayerInterior(plo, GetPlayerInterior(playerid));
if (GetPlayerState(plo) == 2)
{
TelePos[plo][0] = 0.0;
TelePos[plo][1] = 0.0;
new tmpcar = GetPlayerVehicleID(plo);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
}
else
{
SetPlayerPos(plo,plocx,plocy+2, plocz);
}
SendClientMessage(plo, COLOR_GRAD1, " You have been teleported");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not Admin!");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", plo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}