Problem with uf.inc
#1

Hi, I'm scripting my own gamemode and I'm using Pawno. In the current version of my gm, and with a_samp as the only include, it compiles instantly, with no errors and no warnings:







The problem came some days ago, after I downloaded uf.inc from the link provided in https://sampwiki.blast.hk/wiki/Useful_Fu...s_.28uf.inc.29 : only with adding #include <uf> just below #include <a_samp> and not changing anything else, when I try to compile, the "PAWN Compiler Output" window stays in blank during a few seconds:







and then it gives me 3 errors and a full load of warnings, even though, as I mentioned, I haven't changed anything other than just adding the mentioned #include <uf> line.




Код:
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\pawno\include\uf.inc(43) : warning 201: redefinition of constant/macro (symbol "MAX_PICKUPS")
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1393) : error 021: symbol already defined: "OnVehicleSpawn"
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1744) : warning 219: local variable "Angle" shadows a variable at a preceding level
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1746) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1747) : warning 213: tag mismatch
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1747) : warning 213: tag mismatch
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1747) : warning 213: tag mismatch
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1747) : warning 213: tag mismatch
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1747) : warning 213: tag mismatch
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1744) : warning 203: symbol is never used: "Angle"
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1744 -- 1753) : warning 219: local variable "Angle" shadows a variable at a preceding level
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1755) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1756) : warning 213: tag mismatch
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1756) : warning 213: tag mismatch
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1756) : warning 213: tag mismatch
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1756) : warning 213: tag mismatch
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1756) : warning 213: tag mismatch
C:\Documents and Settings\All Users\Documentos\programas d3sc4rg4d0s\samp03dsvr_R2_win32\gamemodes\carfight_aircombat_prueba53_con_uf_inc.pwn(1753) : warning 203: symbol is never used: "Angle"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
As you can see, the very first warning corresponds to the uf include itself. The lines which it talks about are the following, and are inside the OnPlayerCommandText callback:




pawn Код:
//
    if(!strcmp("/rustler", cmdtext, true)) // For testing purposes.
    {
        new Float:x, Float:y, Float:z, Float:Angle;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, Angle);
        CreateVehicle(476, (x + (8 * floatcos( (Angle + 90), degrees ))), (y + (8 * floatsin( (Angle + 90), degrees ))), z, Angle, 0, 1, 60);
        // It spawns a little bit in front of the player and with his same facing angle.
        return 1;
    }
    if(!strcmp("/infernus", cmdtext, true)) // For testing purposes too.
    {
        new Float:x, Float:y, Float:z, Float:Angle;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, Angle);
        CreateVehicle(411, (x + (5 * floatcos( (Angle + 90), degrees ))), (y + (5 * floatsin( (Angle + 90), degrees ))), z, Angle, 0, 1, 60);
        // The very same for the Infernus. It just spawns a little closer to the
        //  player, because it's a smaller vehicle.
        return 1;
    }
As you can see by the comments, these two are just testing commands and they won't be in the final version of my gm, however I still want to keep them and not to have to already remove them just because a fussy include doesn't like them. There are other commands in that callback, and other callbacks and custom functions around, but the uf include doesn't have a problem with them, only with these two commands.
Reply
#2

The uf.inc is utter rubbish if you ask me. Just copy the functions you need to your gamemode or another include.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)