//definicion de dcmd, arriba de todo, debajo de los includes
#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
//definicion del comando
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(pos,3,cmdtext);
return 0;
}
//comando en si
dcmd_pos(playerid, params){
new tmp[256], tmp2[256], tmp3[256], Index;
tmp = strtok(params, Index);
tmp2 = strtok(params, Index);
tmp3 = strtok(params, Index);
if(!strlen(tmp) || !strlen(tmp2) || strlen(tmp3))return SendClientMessage(playerid, 0xFFFF00FF, "Uso: /ir 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 sido teleportado a la posiciуn: %s, %s, %s", X, Y, Z);
return sendClientMessage(playerid, 0xFFFF00FF, str);
}
#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_xgoto(playerid, params[])
{
new Float:x, Float:y, Float:z;
if (sscanf(params, "fff", x, y, z)) SendClientMessage(playerid, 0xFF0000AA, "USE: \"/xgoto <X Float> <Y Float> <Z Float>\"");
else
{
new string[64];
SetPlayerPos(playerid, x, y, z);
format(string, sizeof(string), "You've set your coord to %f, %f, %f", x, y, z);
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(xgoto, 9, cmdtext);
return 0;
}
|
Originally Posted by Distrito 79
Mira, mirando ese codigo vi que el GM que tengo (raven's roleplay) ya lo tiene es "/xgoto" pero no me anda en el juego..
Codigo: pawn Код:
pawn Код:
pawn Код:
|
|
Originally Posted by Distrito 79
Impecable, ahora si quedo anda a Full Mil gracias!
|