Jump to content
  • 0

Problema ban vreau ajutor rpd va rog


Question

Posted

Ma poate ajuta cineva? Cand dau de ex /ban PetardaBUM1998 0 NeAuzim imi apare "syntax: /ban etc

Va rog...

COD: 

YCMD:ban(playerid, params[], help)
{
    if(!PlayerInfo[playerid][pAdmin])
        return SCM(playerid, 0xa3e080FF, "You are not an admin!");

    if(GetPVarInt(playerid, "ban_cooldown") > gettime())
        return SendFormatMessage(playerid, COLOR_GREY, "You need to wait %d seconds for another ban.", (GetPVarInt(playerid, "ban_cooldown") - gettime()));

    new userID, days, reason[64];
    if(sscanf(params, "usd[64]", userID, days, reason) || days < 0)
        return SCM(playerid, -1, "Syntax: /ban <playerid/name> <days (0 = permanent)> <reason>");

    if(!IsPlayerLogged(playerid))
        return SCM(playerid, COLOR_GREY, "This player is not connected!");

    if(userID == playerid)
        return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda aspura ta.");

    if(PlayerInfo[playerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && !strmatch(GetPlayerNameEx(playerid), "R4uL"))
        return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda pe acel jucator.");

    banPlayer(userID, playerid, days, reason);
    return true;

se poate fast?

1 answer to this question

Recommended Posts

  • 0
Posted
if(sscanf(params, "uds[64]", userID, days, reason))

Ordinea argumentelor in sscanf conteza, atat cele din "" cat si cele oferite in paranteze. Si sugerez sa verifici conditia de days < 0 in alt if daca e nevoie

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.