Un Comando
#10

fijate asi...
pawn Код:
if(strcmp(cmdtext, "/comando", true) == 0){
  new tmp2[256], tmp3[256];
  tmp = strtok(cmdtext, idx);
  tmp2 = strtok(cmdtext, idx);
  tmp3 = strtok(cmdtext, idx);
  if(!strlen(tmp) || !strlen(tmp2) || !strlen(tmp3))return SendClientMessage(playerid, color, "ERROR: Uso: /comando <Coordenada X> <Coordenada Y> <Coordenada Z>");
  new Float:X, Float:Y, Float:Z, str[128];
  X = strval(tmp);
  Y = strval(tmp2);
  Z = strval(tmp3);
  SetPlayerPos(playerid, X, Y, Z);
  format(str, sizeof(str), "Has ido a %s, %s, %s", X, Y, Z);
  SendClientMessage(playerid, color, str);
  return 1;
}
si no como el ladmin4v2:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  dcmd(lgoto,7,cmdtext);
  return 0;
}

dcmd_lgoto(playerid,params[]) {
  if(PlayerInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid)) {
    new Float:x, Float:y, Float:z;
    new tmp[256], tmp2[256], tmp3[256];
    new string[128], Index; tmp = strtok(params,Index); tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
    if(!strlen(tmp) || !strlen(tmp2) || !strlen(tmp3)) return SendClientMessage(playerid,red,"USAGE: /lgoto [x] [y] [z]");
    x = strval(tmp);
    y = strval(tmp2);
    z = strval(tmp3);
    //CMDMessageToAdmins(playerid,"LGOTO");
    if(GetPlayerState(playerid) == 2) SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
    else SetPlayerPos(playerid,x,y,z);
    format(string,sizeof(string),"You have teleported to %f, %f, %f", x,y,z); return SendClientMessage(playerid,blue,string);
  } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Reply


Messages In This Thread
Un Comando - by Jesus^ - 14.05.2010, 02:38
Re: Un Comando - by Carlos_Martinez - 14.05.2010, 02:52
Re: Un Comando - by Jesus^ - 14.05.2010, 03:07
Re: Un Comando - by TheChaoz - 14.05.2010, 03:22
Re: Un Comando - by Jesus^ - 14.05.2010, 04:17
Re: Un Comando - by ansuke5000 - 14.05.2010, 14:25
Re: Un Comando - by Jesus^ - 14.05.2010, 14:36
Re: Un Comando - by DanielAvila-17 - 14.05.2010, 17:56
Re: Un Comando - by Cesar_Biker - 14.05.2010, 20:59
Re: Un Comando - by TheChaoz - 14.05.2010, 23:54

Forum Jump:


Users browsing this thread: 1 Guest(s)