SA-MP Forums Archive
[[[Ajuda]]] Ir a uma coordenada - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [[[Ajuda]]] Ir a uma coordenada (/showthread.php?tid=283526)



[[[Ajuda]]] Ir a uma coordenada - Ichigo_Kurosaki - 15.09.2011

Olб pessoal, seria possivel eu digitar IN-GAME ?

/ir [coordenada x,y,z]

Eu nгo to falando de fazer um sistema de /irmorro ou /irls eu falo de /ir na coordenada que eu digitar na hora in-game


Re: [[[Ajuda]]] Ir a uma coordenada - Shelby - 15.09.2011

pawn Код:
CMD:ir(playerid, params[])
{
    //if(!IsPlayerAdmin(playerid)) return 1;
    new Float:gPos[3];
    if(sscanf(params, "fff", gPos[0], gPos[1], gPos[2])) return SendClientMessage(playerid, -1, "Uso correto: /ir [x] [y] [z]");
    SetPlayerPos(playerid, gPos[0], gPos[1], gPos[2]);
    new gString[128];
    format(gString, sizeof(gString), "Vocк teleportou para a coordenada {00FF33}%f %f %f{FFFFFF}.", gPos[0], gPos[1], gPos[2]);
    SendClientMessage(playerid, -1, gString);
    return 1;
}



Re: [[[Ajuda]]] Ir a uma coordenada - Allan Kardec - 15.09.2011

pawn Код:
if(strcmp("/ircord", cmdtext, true) == 0)
{
     new Float:P[3];
     tmp = strtok(cmdtext, idx);
     if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
     P[0] = strval(tmp);
     if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
     P[1] = strval(tmp);
     if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
     P[2] = strval(tmp);
     SetPlayerPos(playerid, P[0], P[1], P[2]);
     format(aStr, sizeof(aStr), "Teleportado atй as cordenadas X » [%f] , Y » [%f] , Z » [%f]", P[0], P[1], P[2]);
     return 1;
}
@edit
Larceny ser emo kkkkk


Respuesta: Re: [[[Ajuda]]] Ir a uma coordenada - Ichigo_Kurosaki - 15.09.2011

Quote:
Originally Posted by Allan Kardec
Посмотреть сообщение
pawn Код:
if(strcmp("/ircord", cmdtext, true) == 0)
{
     new Float:P[3];
     tmp = strtok(cmdtext, idx);
     if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
     P[0] = strval(tmp);
     if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
     P[1] = strval(tmp);
     if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
     P[2] = strval(tmp);
     SetPlayerPos(playerid, P[0], P[1], P[2]);
     format(aStr, sizeof(aStr), "Teleportado atй as cordenadas X » [%f] , Y » [%f] , Z » [%f]", P[0], P[1], P[2]);
     return 1;
}
@edit
Larceny ser emo kkkkk
C:\Users\Pedro\Desktop\LVC\GM\Com Infoorg\Las Venturas City\Las Venturas City\gamemodes\LasVenturas.pwn(39629) : error 017: undefined symbol "aStr"
C:\Users\Pedro\Desktop\LVC\GM\Com Infoorg\Las Venturas City\Las Venturas City\gamemodes\LasVenturas.pwn(39629) : error 017: undefined symbol "aStr"
C:\Users\Pedro\Desktop\LVC\GM\Com Infoorg\Las Venturas City\Las Venturas City\gamemodes\LasVenturas.pwn(39629) : error 029: invalid expression, assumed zero
C:\Users\Pedro\Desktop\LVC\GM\Com Infoorg\Las Venturas City\Las Venturas City\gamemodes\LasVenturas.pwn(39629) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


Esqueci de dizer, sу adm pode usar^^

Linha:

pawn Код:
format(aStr, sizeof(aStr), "Teleportado atй as cordenadas X » [%f] , Y » [%f] , Z » [%f]", P[0], P[1], P[2]);



Respuesta: Re: [[[Ajuda]]] Ir a uma coordenada - Ichigo_Kurosaki - 15.09.2011

Quote:
Originally Posted by Larceny
Посмотреть сообщение
pawn Код:
CMD:ir(playerid, params[])
{
    //if(!IsPlayerAdmin(playerid)) return 1;
    new Float:gPos[3];
    if(sscanf(params, "fff", gPos[0], gPos[1], gPos[2])) return SendClientMessage(playerid, -1, "Uso correto: /ir [x] [y] [z]");
    SetPlayerPos(playerid, gPos[0], gPos[1], gPos[2]);
    new gString[128];
    format(gString, sizeof(gString), "Vocк teleportou para a coordenada {00FF33}%f %f %f{FFFFFF}.", gPos[0], gPos[1], gPos[2]);
    SendClientMessage(playerid, -1, gString);
    return 1;
}
Eu nгo entendi o seu!!


Re: [[[Ajuda]]] Ir a uma coordenada - Shelby - 15.09.2011

Ichigo, aconselho a vocк o uso de ZCMD/YCMD + sscanf, por alйm de ser mais flexнvel й muito mais rбpido.
Quote:
Originally Posted by Ichigo_Kurosaki
Посмотреть сообщение
Esqueci de dizer, sу adm pode usar^^
Se for usar o modo ZCMD+sscanf, apenas tire o comentбrio do meu comando.


Re: [[[Ajuda]]] Ir a uma coordenada - Allan Kardec - 15.09.2011

pawn Код:
if(strcmp("/ircord", cmdtext, true) == 0)
{
     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Somente administrador rcon pode usar!");
     new Float:P[3], aStr[75];
     tmp = strtok(cmdtext, idx);
     if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
     P[0] = strval(tmp);
     if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
     P[1] = strval(tmp);
     if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
     P[2] = strval(tmp);
     SetPlayerPos(playerid, P[0], P[1], P[2]);
     format(aStr, sizeof(aStr), "Teleportado atй as cordenadas X » [%f] , Y » [%f] , Z » [%f]", P[0], P[1], P[2]);
     return 1;
}



Re: [[[Ajuda]]] Ir a uma coordenada - Sergio_MOW - 15.09.2011

Sem double post amigo, o Larceny usou ZCMD + SSCANF para dar velocidade ao code, e atй pela facilidade de usar zcmd, tanto que uso zcmd + sscanf.


edit: responderam primero q eu .


Re: [[[Ajuda]]] Ir a uma coordenada - RebeloX - 15.09.2011

Sim й bom usar zcmd, mas ele deve ter todos os comandos em strcmp.


Respuesta: [[[Ajuda]]] Ir a uma coordenada - Ichigo_Kurosaki - 15.09.2011

Para ultilizar o que faзo?

/ircoord 1529.6,-1691.2,13.3 ?


pawn Код:
if(strcmp("/ircoord", cmdtext, true) == 0)
    {
         if(!IsPlayerAdmin(playerid))
         return 1;
         SendClientMessage(playerid, -1, "Somente administrador rcon pode usar!");
         new Float:P[3], aStr[75];
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
         P[0] = strval(tmp);
         if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
         P[1] = strval(tmp);
         if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
         P[2] = strval(tmp);
         SetPlayerPos(playerid, P[0], P[1], P[2]);
         format(aStr, sizeof(aStr), "Teleportado atй as cordenadas X » [%f] , Y » [%f] , Z » [%f]", P[0], P[1], P[2]);
         return 1;
    }
@edit

Meu gm nao tem comandos em zmd