Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

SSCANF Errors

$
0
0
PHP Code:

CMD:unpackageweapon(playeridparams[])
{
    new 
playerpackagetypestr[128];
    if(
sscanf(params"su"packagetypeplayerid)) return SendClientMessage(playeridCOLOR_GRAY"/unpackage [playerid] [packagetype]");
    {
        if(
IsInRangeOfPlayer(playeridplayer5))
        {
            if(!
strcmp(packagetype"pistol"true))
            {
                if(
Inventory[playerid][PistolPackage] > 0)
                {
                    
TakeInventoryItem(playeridPISTOLPACKAGE1);
                    
GivePlayerGun(player24100);

                }
                else 
SendErrorMessage(playerid"You don't have this item.");
                return 
1;
            }
            else if(!
strcmp(packagetype"shotgun"true))
            {
                if(
Inventory[playerid][ShotgunPackage] > 0)
                {
                    
TakeInventoryItem(playeridSHOTGUNPACKAGE1);
                    
GivePlayerGun(player25125);

                }
                else 
SendErrorMessage(playerid"You don't have this item.");
                }
                else if(!
strcmp(packagetype"automatic"true))
            {
                if(
Inventory[playerid][AutomaticRiflePackage] > 0)
                {
                    
TakeInventoryItem(playeridAUTOMATICRIFLEPACKAGE1);
                    
format(strsizeof(str), "%s hands an M4 to %s. "GetRoleplayName(playerid), GetRoleplayName(player));
                    
SetPlayerChatBubble(playeridstrCOLOR_RPRange_Short7000);
                    
GivePlayerGun(player31250);
                }
                    else if(!
strcmp(packagetype"molotov"true))
            {
                if(
Inventory[playerid][ExplosivePackage] > 0)
                {
                    
TakeInventoryItem(playeridEXPLOSIVEPACKAGE1);
                    
format(strsizeof(str), "%s hands a Molotov %s. "GetRoleplayName(playerid), GetRoleplayName(player));
                    
SetPlayerChatBubble(playeridstrCOLOR_RPRange_Short7000);
                    
GivePlayerGun(player181);
                }
                else 
SendErrorMessage(playerid"You don't have this item.");

                return 
1;
                }
            }
        }
        else 
SendErrorMessage(playerid"You are too far away from this player.");

    }
    return 
1;


PHP Code:

C:\Users\Austin\Desktop\Stuff\United Roleplay\gamemodes\U:RP-R39.pwn(17007) : error 035argument type mismatch (argument 1)
C:\Users\Austin\Desktop\Stuff\United Roleplay\gamemodes\U:RP-R39.pwn(17018) : error 035argument type mismatch (argument 1)
C:\Users\Austin\Desktop\Stuff\United Roleplay\gamemodes\U:RP-R39.pwn(17028) : error 035argument type mismatch (argument 1)
C:\Users\Austin\Desktop\Stuff\United Roleplay\gamemodes\U:RP-R39.pwn(17037) : error 035argument type mismatch (argument 1 

These are the lines, where it has "packagetype". Why is this?

PHP Code:

else if(!strcmp(packagetype"pistol"true)) 


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>