Un Comando
#1

Hola
Alguien tiene un Comando de que puedas poner /GotoCoordenada -1776.402465,13.546895,6.091176
y te lleve a ese coordenada?
Reply
#2

Recien se havia posteado uno, no se por qe no buscas.

pawn Код:
if(!strcmp(cmdtext, "/goto", true))
  {


 SetPlayerPos(playerid,x,y,z);// en x y z pon las cordenadas
 SendClientMessaje(playerid,color,"Mensaje qe kieras qe aparesca ");
return 1;

}
Reply
#3

Si lo quisiera Asi, no hubiera Posteado.
Reply
#4

pawn Код:
if(strcmp(cmdtext, "/comando", true) == 0){
  new tmp[256], tmp2[256], tmp3[256], idx;
  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);
  return SendClientMessage(playerid, color, str);
}
ahi lo tenes...

Nota: no es tanto trabajo buscarlo en algun fs... (EJ: Ladmin) o siquiera pensarlo...
Reply
#5

Como Puedo Solucionar estos 2 Warnings:

Код:
C:\Documents and Settings\Pierson\Escritorio\Servidor RevoGamerZ\gamemodes\Rg-Rp.pwn(41336) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Pierson\Escritorio\Servidor RevoGamerZ\gamemodes\Rg-Rp.pwn(41336) : warning 219: local variable "idx" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Pongo /comando 598.595092 -1284.142944 15.949995
y me Dice: Error, /ayuda
Ese Mensaje lo tengo a Lo Ultimo del OnPlayerCommandText xD
Osea, es como si no existiera el Comando :S pero pongo /comando Solamente y me dice el mensaje del comando
Reply
#6

yo tn bien estaba buscando eso.. toma este ami me pasaba = que ati

[quote]else if(strcmp(cmdtext,"/sutntansuke",true)== 0){
SetPlayerPos(playerid,1808.51,-2435.98,13.55);
ResetPlayerWeapons(playerid);
return 1;}/quote]




[quote]SetPlayerPos(playerid,"AQUI BAN LAS CORDENADAS");/quote]




Reply
#7

[quote=ansuke5000 ]
yo tn bien estaba buscando eso.. toma este ami me pasaba = que ati

[quote]else if(strcmp(cmdtext,"/sutntansuke",true)== 0){
SetPlayerPos(playerid,1808.51,-2435.98,13.55);
ResetPlayerWeapons(playerid);
return 1;}/quote]




Quote:

SetPlayerPos(playerid,"AQUI BAN LAS CORDENADAS");/quote]

Porfavor, Asegurate de leer las respuestas de los post, para que no responder lo mismo.
Reply
#8

Este codigo te va a servir... a mi me funciona
pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
pawn Код:
dcmd_comando(playerid, params[])
{
    new Float:x, Float:y, Float:z;
    if (sscanf(params, "fff", x, y, z)) SendClientMessage(playerid, 0xFF0000AA, "USE: \"/comando <Coordenada X> <Coordenada Y> <Coordenada Z>\"");
    else
    {
      new string[64];
      SetPlayerPos(playerid, x, y, z);
      format(string, sizeof(string), "Usted ha sido teletransportado a la posision %f, %f, %f", x, y, z);
      SendClientMessage(playerid, 0xFFFFFFFF, string);
    }
    return 0;
}
Reply
#9

Y agrega esto tambiйn:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(comando,7,cmdtext);// el 7 es el numero de caracteres que tiene: 1-c; 2-o; 3-m; 4-a; 5-n; 6-d; 7-o; xD
    ...
}
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)