SA-MP Forums Archive
No me funciona - 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: No me funciona (/showthread.php?tid=202549)



No me funciona - SAMPGammer - 24.12.2010

Hola, hoy he querido hacer un comando de cambiar el text y un intento de utofix pero me da estps wrnings
-------------
CODIGO:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]);
new a = 1;
new b = 2;
new c = 3;
// mas abajo...
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0) //para cambiar el texto
    {
        if(IsPlayerAdmin)
        {
        SetGameModeText("It's X-MAS!");
        }
        else
        {
        SendClientMessage(playerid, 0xFFFFFFFF, "You aren't a RCON admin");
        }
    return 1;
   }
   return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) //mientras a = 1, b = 2 y c = 3 repara el coche
{
    while(a == 1 || b == 2 || c == 3)
    {
    SetVehicleHealth(vehicleid, 1000);
    RepairVehicle(vehicleid);
    }
    return 1;
}
Y...
Код:
new.pwn(95) : error 055: start of function body without function header
new.pwn(96) : error 010: invalid function or declaration
new.pwn(98) : error 010: invalid function or declaration
new.pwn(102) : error 010: invalid function or declaration
new.pwn(106) : error 010: invalid function or declaration
new.pwn(108) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase



Re: No me funciona - MrDeath537 - 24.12.2010

pawn Код:
new a = 1;
new b = 2;
new c = 3;


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0) //para cambiar el texto
    {
        if(IsPlayerAdmin)
        {
        SetGameModeText("It's X-MAS!");
        }
        else
        {
        SendClientMessage(playerid, 0xFFFFFFFF, "You aren't a RCON admin");
        }
    return 1;
   }
   return 0;
}
Y por cierto, esto es un FAIL:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) //mientras a = 1, b = 2 y c = 3 repara el coche
{
    while(a == 1 || b == 2 || c == 3)
    {
    SetVehicleHealth(vehicleid, 1000);
    RepairVehicle(vehicleid);
    }
    return 1;
}
Si a, b y c no cambian nunca, eso crearнa un loop infinito y detendrнa hasta la sincronizaciуn del server.


Respuesta: No me funciona - TheChaoz - 24.12.2010

creo q con lo que te dijo MrDeath se solucionara todo. exagerast un poquito con lo de la syncro che...


Re: Respuesta: No me funciona - Zamaroht - 24.12.2010

Quote:
Originally Posted by the_chaoz
Посмотреть сообщение
creo q con lo que te dijo MrDeath se solucionara todo. exagerast un poquito con lo de la syncro che...
No, lo de la sincronizaciуn es verdad. Acordate que los script de SA-MP funcionan en un solo hilo, por lo tanto debe estar "libre" para que otro callback sea llamado. Caer en un loop infinito detiene totalmente la sincronizaciуn del server, incluso aquellas cosas que no estan directamente relacionadas con el script (como el movimiento de los jugadores).


Respuesta: Re: Respuesta: No me funciona - TheChaoz - 24.12.2010

Quote:
Originally Posted by Zamaroht
Посмотреть сообщение
No, lo de la sincronizaciуn es verdad. Acordate que los script de SA-MP funcionan en un solo hilo, por lo tanto debe estar "libre" para que otro callback sea llamado. Caer en un loop infinito detiene totalmente la sincronizaciуn del server, incluso aquellas cosas que no estan directamente relacionadas con el script (como el movimiento de los jugadores).
no pense q para tanto.... si pense q causaria mucho lag pero no q iva a quedar freezado x asi decirlo.