SA-MP Forums Archive
R5 Server update causing problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: R5 Server update causing problem (/showthread.php?tid=274227)



R5 Server update causing problem - Famalamalam - 05.08.2011

Hello, I just update my server package to R5 and re-compiled my game-mode.

On entering the server, commands don't seem to work correctly anymore, for example:

pawn Код:
CMD:givearms(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))
    {
        new weaponid, ammo, string[128], gun[30], playa;
        if(sscanf(params, "uii", playa, weaponid, ammo)) return SendClientMessage(playerid, White, "USAGE: /givearms [playerID] [weaponID] [Ammo]");
        if(weaponid > 46 || weaponid < 1) return SendClientMessage(playerid,Red,"Invalid Weapon ID!");
        if(IsPlayerConnected(playa) && PlayerInfo[playa][LoggedIn])
        {
            GetWeaponName(weaponid,gun,30);
            if(playa != playerid)
            {
                format(string,sizeof(string),"You gave %s a %s with %d rounds of ammunition!", pName(playa),gun, ammo); SendClientMessage(playerid,White,string);
                format(string,sizeof(string),"You have recieved a %s with %d round of ammunition from Administrator %s",gun, ammo, pName(playerid)); SendClientMessage(playa, Green, string);
                format(string,sizeof(string),"%s gave %s a %s with %d rounds of ammunition",pName(playerid),pName(playa),gun, ammo); MessageToAdmins(White, string);
                return GivePlayerWeapon(playa, weaponid, ammo);
            } else {
                format(string,sizeof(string),"You gave yourself a %s with %d rounds of ammunition!", gun, ammo); SendClientMessage(playerid,White,string);
                format(string,sizeof(string),"%s gave himself a %s with %d rounds of ammunition",pName(playerid),gun, ammo); MessageToAdmins(White, string);
                return GivePlayerWeapon(playa, weaponid, ammo);
            }
        } else return SendClientMessage(playerid, Red,"Player is not connected or is not logged in!");
    } else return 0;
}
Displays the "Player is not connected or is not logged in" message when I try it on myself, what is this due to? Is the variable not being set anymore or something? Or is IsPlayerConnected failing?


Re: R5 Server update causing problem - Donya - 05.08.2011

update your sscanf, check the topic...


Re: R5 Server update causing problem - [L3th4l] - 05.08.2011

Have you tried upgrading sscanf plugin to with with .3c R5? Here's the download link: http://solidfiles.com/d/329c7/


Re: R5 Server update causing problem - Famalamalam - 05.08.2011

Ahh, my bad, I never saw that! Thanks a bunch