Roadblock Problem
#1

im having a problem with my roadblock system
this is the first time ever its happened ( i always use this )
PHP код:
sscanf warning Format Specifier Does Not Match Parameter Count
sscanf warning Unknown format 
pawn Код:
CMD:roadblock(playerid, params[])// road block command
{
    if(sscanf(params, "s[100]", params))
    {
        SendClientMessage(playerid, -1, "Usage: /roadblock [ID]");
        return 1;
    }
    if (PlayerInfo[playerid][pFaction] >=0){
    if(sscanf(params, "1", params)){
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    CreateObject(playerid,1422, X, Y, Z, 30, 0 );
    }
    else if(sscanf(params, "2", params)){
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    CreateObject(playerid, 1423, X, Y, Z, 30, 0 );
    }
    else if(sscanf(params, "3", params)){
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    CreateObject(playerid, 1424, X, Y, Z, 30, 0 );
    }
    else if(sscanf(params, "4", params)){
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    CreateObject(playerid, 1425, X, Y, Z, 30, 0 );
    }
    else if(sscanf(params, "5", params)){
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    CreateObject(playerid, 1427, X, Y, Z, 30, 0 );
    }
    else if(sscanf(params, "6", params)){
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    CreateObject(playerid, 1434, X, Y, Z, 30, 0 );
    }
    }
    return 1;
}
Reply
#2

Here:
You were using SSCANF wrong aha.

pawn Код:
CMD:roadblock(playerid, params[])// road block command
{
    new number;
    if(sscanf(params, "i", number))
    {
        SendClientMessage(playerid, -1, "Usage: /roadblock [ID]");
        return 1;
    }
    if (PlayerInfo[playerid][pFaction] >=0)
    {
        if(number == 1)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateObject(playerid,1422, X, Y, Z, 30, 0 );
        }
        else if(number == 2)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateObject(playerid, 1423, X, Y, Z, 30, 0 );
        }
        else if(number == 3)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateObject(playerid, 1424, X, Y, Z, 30, 0 );
        }
        else if(number == 4)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateObject(playerid, 1425, X, Y, Z, 30, 0 );
        }
        else if(number == 5)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateObject(playerid, 1427, X, Y, Z, 30, 0 );
        }
        else if(number == 6)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateObject(playerid, 1434, X, Y, Z, 30, 0 );
        }
    }
    return 1;
}

if you want an explanation, let me know!
Reply
#3

ok thanks
Reply
#4

the object aint spawning
Reply
#5

That should work!
Reply
#6

for some reason its not ??
Reply
#7

Post me errors, please.
Reply
#8

there are not error its just not spawning the objects
Reply
#9

My bad...Try this:

pawn Код:
CMD:roadblock(playerid, params[])// road block command
{
    new number;
    if(sscanf(params, "i", number)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /roadblock [ID]");

    if (PlayerInfo[playerid][pFaction] >=0)
    {
        if(number == 1)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateObject(playerid,1422, X, Y, Z, 30, 0 );
        }
        else if(number == 2)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateObject(playerid, 1423, X, Y, Z, 30, 0 );
        }
        else if(number == 3)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateObject(playerid, 1424, X, Y, Z, 30, 0 );
        }
        else if(number == 4)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateObject(playerid, 1425, X, Y, Z, 30, 0 );
        }
        else if(number == 5)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateObject(playerid, 1427, X, Y, Z, 30, 0 );
        }
        else if(number == 6)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateObject(playerid, 1434, X, Y, Z, 30, 0 );
        }
    }
    return 1;
}
That should be it.
Reply
#10

nothing??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)