04.01.2015, 15:08
Hi all!
Recently we added the "OnPlayerCommandText" a gamemode that was not installed.
I added a command and it does not work (I do not give any compile error)
What can I do?
PHP код:
//---------------------------<[ 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;
}
I added a command and it does not work (I do not give any compile error)
What can I do?