//---------------------------<[ OnPlayerCommandText ]>--------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new cmd[256];
new idx;
new tmp[256];
cmd = strtok(cmdtext, idx);
//-
if(strcmp(cmd, "/goto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(Info[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "[INFO] {FFFFFF} /goto [ID/PlayerName]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
GetPlayerPos(plo,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;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
SetPlayerInterior(playerid,GetPlayerInterior(plo));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(plo));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are teleported");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not autorized!");
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", plo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
}
return 1;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new cmd[256];
new idx;
new tmp[256];
cmd = strtok(cmdtext, idx);
//-
if(strcmp(cmd, "/goto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(Info[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "[INFO] {FFFFFF} /goto [ID/PlayerName]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
GetPlayerPos(plo,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;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
SetPlayerInterior(playerid,GetPlayerInterior(plo));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(plo));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are teleported");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not autorized!");
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", plo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
}
return 1;
}
return 0;
}
Try this sir
pawn Код:
|
It won't if you're using any other command processors like zcmd or ycmd.
|
Remove the command processors. But remember that doing so is a massive downgrade.
|
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new cmd[256];
new idx;
new tmp[256];
cmd = strtok(cmdtext, idx);
//-
if(strcmp(cmd, "/goto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(Info[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "[INFO] {FFFFFF} /goto [ID/PlayerName]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
GetPlayerPos(plo,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;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
SetPlayerInterior(playerid,GetPlayerInterior(plo));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(plo));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are teleported");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not autorized!");
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", plo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
}
return 1;
}
return 0;
}