[AJUDA]O que, que tem de erro no cmd?
#1

Esse й o CMD:

pawn Код:
if(!strcmp(cmdtext, "/sp", true))
        {
            GetPlayerPos(playerid, 0.0, 0.0, 0.0);
            format(var2, 256, "Vocк salvou sua posiзгo nas coordenadas: %f, %f, %f", 3368, 4168, 4968);
            SendClientMessage(playerid, 0xF6F600AA, var2);
            return 1;
        }
    if(!strcmp(cmdtext, "/ip", true))
        {
            SetPlayerPos(playerid, globD28[playerid], glob1048[playerid], glob1368[playerid]);
            format(var2, 256, "Vocк setou sua posiзгo nas coordenadas: %f, %f, %f", 3368, 4168, 4968);
            SendClientMessage(playerid, 0xF6F600AA, var2);
            return 1;
        }
    return 0;
}
Erros:
Код:
C:\Users\Gabriel\Desktop\sal.pwn(100) : error 035: argument type mismatch (argument 2)
C:\Users\Gabriel\Desktop\sal.pwn(105) : warning 217: loose indentation
C:\Users\Gabriel\Desktop\sal.pwn(107) : error 017: undefined symbol "globD28"
C:\Users\Gabriel\Desktop\sal.pwn(107) : warning 215: expression has no effect
C:\Users\Gabriel\Desktop\sal.pwn(107) : error 001: expected token: ";", but found "]"
C:\Users\Gabriel\Desktop\sal.pwn(107) : error 029: invalid expression, assumed zero
C:\Users\Gabriel\Desktop\sal.pwn(107) : fatal error 107: too many error messages on one line

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


5 Errors.
Obrigado desde jб, quem me ajudar.
Reply
#2

pawn Код:
if(!strcmp(cmdtext, "/sp", true))
        {
            GetPlayerPos(playerid,x,y,z);
            format(var2, 256, "Vocк salvou sua posiзгo nas coordenadas: %f, %f, %f", x, y, z);
            SendClientMessage(playerid, 0xF6F600AA, var2);
            return 1;
        }
    if(!strcmp(cmdtext, "/ip", true))
        {
            SetPlayerPos(playerid, x,y,z);
            format(var2, 256, "Vocк setou sua posiзгo nas coordenadas: %f, %f, %f", x, y, z);
            SendClientMessage(playerid, 0xF6F600AA, var2);
            return 1;
        }
    return 0;
}
Reply
#3

Inicio do GM
pawn Код:
new Float: PlayerX[MAX_PLAYERS], Float: PlayerY[MAX_PLAYERS], Float: PlayerZ[MAX_PLAYERS];
OnPlayerCommandText
pawn Код:
if(strcmp("/sp", cmdtext, true, 10) == 0)
    {
       new Float:X, Float:Y, Float:Z, string[128];
       GetPlayerPos(playerid, X, Y, Z);
       format(string, sizeof(string), "Vocк salvou sua posiзгo como %f,%f,%f", X, Y, Z);
       SendClientMessage(playerid, 0xFFFFFFFF, string);
       PlayerX[playerid] = X;
       PlayerY[playerid] = Y;
       PlayerZ[playerid] = Z;
       return 1;
    }
    if(strcmp("/vp", cmdtext, true, 10) == 0)
    {
       new string[128];
       SetPlayerPos(playerid, PlayerX[playerid], PlayerY[playerid], PlayerZ[playerid]);
       format(string, sizeof(string), "Vocк voltou a posiзгo %f,%f,%f", PlayerX[playerid], PlayerY[playerid], PlayerZ[playerid]);
       SendClientMessage(playerid, 0xFFFFFFFF, string);
       return 1;
    }
Reply
#4

Alйm da identaзгo? Do espaceamento?
Reply
#5

Seus erros:
pawn Код:
if(!strcmp(cmdtext, "/ip", true)) //! significa diferente, ou seja, senгo for /ip
if(!strcmp(cmdtext, "/sp", true)) //! significa diferente, ou seja, senгo for /sp
GetPlayerPos(playerid, 0.0, 0.0, 0.0); //Estб pegando Latitude Longitude e Altitude 0.0, faltou variбveis com TAG Float e faltou getalas no lugar do 0.0.
format(var2, 256, "Vocк setou sua posiзгo nas coordenadas: %f, %f, %f", 3368, 4168, 4968); //A definiзгo do que serб %f estб errada, alйm de nгo ser uma Float tambйm nгo й uma variбvel.
SetPlayerPos(playerid, globD28[playerid], glob1048[playerid], glob1368[playerid]); //Vocк nгo definiu o valor de glob no comando /sp, e tambйm nгo criou essa variбvel.
Reply
#6

O !strcmp funciona. Da na mesma de strcmp(...) == 0.
Reply
#7

Quote:
Originally Posted by Josma_cmd
Посмотреть сообщение
Inicio do GM
pawn Код:
new Float: PlayerX[MAX_PLAYERS], Float: PlayerY[MAX_PLAYERS], Float: PlayerZ[MAX_PLAYERS];
OnPlayerCommandText
pawn Код:
if(strcmp("/sp", cmdtext, true, 10) == 0)
    {
       new Float:X, Float:Y, Float:Z, string[128];
       GetPlayerPos(playerid, X, Y, Z);
       format(string, sizeof(string), "Vocк salvou sua posiзгo como %f,%f,%f", X, Y, Z);
       SendClientMessage(playerid, 0xFFFFFFFF, string);
       PlayerX[playerid] = X;
       PlayerY[playerid] = Y;
       PlayerZ[playerid] = Z;
       return 1;
    }
    if(strcmp("/vp", cmdtext, true, 10) == 0)
    {
       new string[128];
       SetPlayerPos(playerid, PlayerX[playerid], PlayerY[playerid], PlayerZ[playerid]);
       format(string, sizeof(string), "Vocк voltou a posiзгo %f,%f,%f", PlayerX[playerid], PlayerY[playerid], PlayerZ[playerid]);
       SendClientMessage(playerid, 0xFFFFFFFF, string);
       return 1;
    }
Coloquei o cmd que vocк me passou mais da erros na linha 99, nгo й reconhecнvel pelo pwn,"PlayerX", serб preciso usar uma variбvel?

Erros:
Код:
C:\Users\Gabriel\Desktop\sal.pwn(99) : error 017: undefined symbol "PlayerX"
C:\Users\Gabriel\Desktop\sal.pwn(99) : warning 215: expression has no effect
C:\Users\Gabriel\Desktop\sal.pwn(99) : error 001: expected token: ";", but found "]"
C:\Users\Gabriel\Desktop\sal.pwn(99) : error 029: invalid expression, assumed zero
C:\Users\Gabriel\Desktop\sal.pwn(99) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#8

Vocк tem que colocar no inicio do gm
pawn Код:
new Float:PlayerX[MAX_PLAYERS],
     Float:PlayerY[MAX_PLAYERS],
     Float:PlayerZ[MAX_PLAYERS];
comando:
pawn Код:
if(!strcmp("/sp", cmdtext, true))
     {
          new msg[128];
          GetPlayerPos(playerid, PlayerX[playerid], PlayerY[playerid], PlayerZ[playerid]);
          format(msg, sizeof(msg), "Vocк salvou sua posiзгo como %f,%f,%f", PlayerX[playerid], PlayerY[playerid], PlayerZ[playerid]);
          SendClientMessage(playerid, 0xFFFFFFFF, msg);
          return 1;
     }
     if(!strcmp("/vp", cmdtext, true))
     {
          new msg[128];
          SetPlayerPos(playerid, PlayerX[playerid], PlayerY[playerid], PlayerZ[playerid]);
          format(msg, sizeof(msg), "Vocк voltou a posiзгo %f,%f,%f", PlayerX[playerid], PlayerY[playerid], PlayerZ[playerid]);
          SendClientMessage(playerid, 0xFFFFFFFF, msg);
          return 1;
     }
Reply
#9

Muito obrigado Dr_pawno, me ajudou bastante.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)