SA-MP Forums Archive
Error con este comando - 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: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Error con este comando (/showthread.php?tid=286689)



Error con este comando - chucho - 30.09.2011

hola bueno quiero saber por que me da ese error lo que quiero es que este comando sea para usuarios con nivel 1

pawn Код:
if (strcmp("/ir", cmd, true, 10) == 0)
    {
    {
    if (Informacion[playerid][Premium] >= 1)
    {
    new tmp[256];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFFFFF, "/ir [playerid]");
    new giveplayerid = strval(tmp);
    if(block[giveplayerid] == 0) return SendClientMessage(playerid, 0xFFFFFF, "El jugador Tiene desactivado el teleport hacia el");
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(giveplayerid, X, Y, Z);
    TeleportPlayer(playerid, X + 2, Y, Z);
    return 1;
    }
pawn Код:
.pwn(118) : error 004: function "Login" is not implemented
.pwn(176) : error 017: undefined symbol "MensajesVip"
.pwn(185) : error 017: undefined symbol "strtok"
.pwn(185) : error 033: array must be indexed (variable "cmd")
.pwn(196) : error 079: inconsistent return types (array & non-array)
.pwn(206) : error 079: inconsistent return types (array & non-array)
.pwn(218) : error 079: inconsistent return types (array & non-array)
.pwn(220) : error 079: inconsistent return types (array & non-array)
.pwn(227) : error 017: undefined symbol "strtok"
.pwn(227) : error 033: array must be indexed (variable "tmp1")
.pwn(228) : error 017: undefined symbol "strtok"
.pwn(228) : error 033: array must be indexed (variable "tmp2")
.pwn(229) : error 079: inconsistent return types (array & non-array)
.pwn(234) : error 079: inconsistent return types (array & non-array)
.pwn(235) : error 079: inconsistent return types (array & non-array)
.pwn(247) : error 079: inconsistent return types (array & non-array)
.pwn(249) : error 079: inconsistent return types (array & non-array)
.pwn(250) : error 079: inconsistent return types (array & non-array)
.pwn(266) : error 079: inconsistent return types (array & non-array)
.pwn(267) : error 079: inconsistent return types (array & non-array)
.pwn(281) : error 079: inconsistent return types (array & non-array)
.pwn(289) : error 017: undefined symbol "strtok"
.pwn(289) : error 033: array must be indexed (variable "tmp")
.pwn(290) : error 079: inconsistent return types (array & non-array)
.pwn(292) : error 079: inconsistent return types (array & non-array)
.pwn(295) : error 017: undefined symbol "TeleportPlayer"

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.



Codigo compilado sin error
pawn Код:
if (strcmp("/ir", cmd, true, 10) == 0)
    {
    new tmp[256];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFFFFF, "/ir [playerid]");
    new giveplayerid = strval(tmp);
    if(block[giveplayerid] == 0) return SendClientMessage(playerid, 0xFFFFFF, "El jugador Tiene desactivado el teleport hacia el");
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(giveplayerid, X, Y, Z);
    TeleportPlayer(playerid, X + 2, Y, Z);
    return 1;
    }



Respuesta: Error con este comando - TheChaoz - 30.09.2011

cerraste todas las llaves q abriste? especialmente la que tenes de mas.


Respuesta: Error con este comando - chucho - 30.09.2011

lo hize haci pero me dan unos errores
pawn Код:
if (strcmp("/ir", cmd, true, 10) == 0)
    {
    if (Informacion[playerid][Premium] >= 1)
    }
    new tmp[256];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFFFFF, "/ir [playerid]");
    new giveplayerid = strval(tmp);
    if(block[giveplayerid] == 0) return SendClientMessage(playerid, 0xFFFFFF, "El jugador Tiene desactivado el teleport hacia el");
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(giveplayerid, X, Y, Z);
    TeleportPlayer(playerid, X + 2, Y, Z);
    return 1;
    }
estos son los errores
pawn Код:
.pwn(286) : error 029: invalid expression, assumed zero
.pwn(286 -- 287) : warning 215: expression has no effect
.pwn(287) : error 001: expected token: ";", but found "new"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.



Respuesta: Error con este comando - TheChaoz - 30.09.2011

tenes que razonar lo que escribis.
como vas a cerrar un bracket luego de un if, al cual nisiquiera le colocaste algo...
pawn Код:
if(!strcmp("/ir", cmd, true, 10)){
    if (Informacion[playerid][Premium] > 0){
        new tmp[256];
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFFFFF, "/ir [playerid]");
        new giveplayerid = strval(tmp);
        if(!block[giveplayerid]) return SendClientMessage(playerid, 0xFFFFFF, "El jugador Tiene     desactivado el teleport hacia el");
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(giveplayerid, X, Y, Z);
        TeleportPlayer(playerid, X + 2, Y, Z);
        return 1;
    }return SendClientMessage(playerid, 0xFF0000FF, "No tienes el nivel premium necesario.");//linea agregada
}



Respuesta: Error con este comando - chucho - 30.09.2011

Perdona no razone esa ultima linea gracias en verdad