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;
}
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);
}
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
|
SetPlayerPos(playerid,"AQUI BAN LAS CORDENADAS");/quote] |
#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
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;
}
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
...
}
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;
}
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");
}