Undefined symbol str
#1

How to make that to show reason and admin in samp.ban file? When ban(playerid); i didn't get any errors, but when I change it to BanEx(playerid, str) i receive Undefined symbol str error. Thi is my ban cmd:

Код:
CMD:ban( playerid, params[ ] )
{
    if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage( playerid, -1, "Tu ne administratorius!" );
    new
        id,
        reason[ 64 ]
    ;
    if(sscanf( params, "us[64]", id, reason ) ) return SendClientMessage( playerid, -1, "Naudojimas: /ban [Nickas] [Prieћastis]" );
    if( !IsPlayerConnected( id ) || id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Tokio ћaidėjo nėra." );
    if(PlayerInfo[id][pPadmin] == 1) return SendClientMessage(playerid, -1, "Ką čia darai?");
    new
        str[ 128 ],
        pName[ MAX_PLAYER_NAME ],
        aName[ MAX_PLAYER_NAME ]
    ;
    GetPlayerName( playerid, aName, MAX_PLAYER_NAME );
    GetPlayerName( id, pName, MAX_PLAYER_NAME );
    format( str, sizeof( str ), "%s Uћblokavo ћaidėją %s. (Prieћastis: %s)", aName, pName, reason );
    SendClientMessageToAll( -1, str );
    BanWithMessage(id, str);
    return 1;
}
This is place where I get error:

Код:
forward BanPublic(playerid);
public BanPublic(playerid) { BanEx(playerid, str); }
BanWithMessage(playerid, message[])
{
    SetTimerEx("BanPublic", 1000, 0, "d", playerid);
    return 1;
}
I try'ed to write new str, pname ant others, but received many errors.
Reply
#2

To use something like that, you must include it in the parameters, for example:
pawn Код:
forward public DoSomethingTo();
public DoSomethingTo()
{
 Kick(playerid);
 return 1;
}
This would give me an error, there I need to do something like this:
pawn Код:
forward public DoSomeThingTo(playerid);
public DoSomeThingTo(playerid)
{
 Kick(playerid);
 return 1;
}
Hence, in your BanPublic, use BanPublic(playerid, const string);
Reply
#3

Don't use the 'BanWithMessage' function then.

pawn Код:
stock BanPublic(playerid,message[])
{
    BanEx(playerid, message);
}
EDIT: You don't even need to use the stock I've made, you got everything you need in the 'BanEx' function.
Reply
#4

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
To use something like that, you must include it in the parameters, for example:
pawn Код:
forward public DoSomethingTo();
public DoSomethingTo()
{
 Kick(playerid);
 return 1;
}
This would give me an error, there I need to do something like this:
pawn Код:
forward public DoSomeThingTo(playerid);
public DoSomeThingTo(playerid)
{
 Kick(playerid);
 return 1;
}
Hence, in your BanPublic, use BanPublic(playerid, const string);
How it should look like with my code?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)