Issue with sscanf and strcmp
#1

Can somebody explain to me, how the /frespawn all works, but frespawn <id> no longer works? It worked before I changed if(str to if(!str

pawn Code:
YCMD:frespawn(playerid, params[]) {
    new vehicleid, text[12];

    if(PlayerInfo[playerid][pFaction] != 0 && FactionInfo[PlayerInfo[playerid][pFaction]][fLeaderrank] >= PlayerInfo[playerid][pRank] - 1)
    {      
        if(sscanf(params, "s[12]", text)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /frespawn [vehicleid/all]");
        if(!strcmp("all", text))
        {
            for(new v = GetVehiclePoolSize(); v > 0; v--)
            {
                if(VehicleInfo[v][vFaction] != 0 && PlayerInfo[playerid][pFaction])
                {
                    SetVehicleToRespawn(v);
                }
            }
        return 1;
        }
        else
        {
            new vehicleidint = strval(text);

            if(VehicleInfo[vehicleidint][vFaction] == PlayerInfo[vehicleidint][pFaction])
            {
                SetVehicleToRespawn(vehicleidint);
               
            }
        }
    }
    else return SendClientMessage(playerid, -1, "nope...");
    return 1;
}
Reply


Messages In This Thread
Issue with sscanf and strcmp - by EmilLykke - 22.01.2019, 18:26
Re: Issue with sscanf and strcmp - by Jefff - 22.01.2019, 18:46
Re: Issue with sscanf and strcmp - by EmilLykke - 22.01.2019, 19:14
Re: Issue with sscanf and strcmp - by EmilLykke - 22.01.2019, 19:43
Re: Issue with sscanf and strcmp - by EmilLykke - 22.01.2019, 20:10

Forum Jump:


Users browsing this thread: 1 Guest(s)