17.07.2009, 18:41
Hey,
Atm I only know how to make commands with dcmd.. And idk.. some commands take about 2-4 seconds to process..
Here are two of them:
So is it possible to make them to work faster?
Atm I only know how to make commands with dcmd.. And idk.. some commands take about 2-4 seconds to process..
Here are two of them:
pawn Код:
dcmd_goto(playerid,params[]) // This command teleports me to player
{
if (dUserINT(PlayerName(playerid)).("Adminlvl")>=2)
{
new id, Float:x,Float:y,Float:z;
if (sscanf(params, "u", id)) UsageMsg(playerid, "USAGE: /goto <PlayerID/PartOfName>");
else if (id == INVALID_PLAYER_ID) ErrorMsg(playerid, "Player not found");
else
{
GetPlayerPos(id,x,y,z);
new interior = GetPlayerInterior(id);
SetPlayerInterior(playerid,interior);
SetPlayerPos(playerid,x,y+2,z+1);
}
}
return 1;
}
dcmd_getplayer(playerid,params[]) //This command teleports player to me
{
if (dUserINT(PlayerName(playerid)).("Adminlvl")>=2)
{
new id, Float:x,Float:y,Float:z;
if (sscanf(params, "u", id)) UsageMsg(playerid, "USAGE: /getplayer <PlayerID/PartOfName>");
else if (id == INVALID_PLAYER_ID) ErrorMsg(playerid, "Player not found");
else
{
if (IsPlayerInAnyVehicle(id)) RemovePlayerFromVehicle(id);
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(id,x,y+2,z+1);
}
}
return 1;
}