Closing samp-server.exe
#1

Something about this command is not working i mean when i type for example /ban 0 bla blabla it wont ban / show text draws it just shows This command does not exist, for more commands type /help but when i type /ban 0 bla it bans idk why but it doesn't let reason to be spaced.


pawn Код:
CMD:ban(playerid, params[])
{
    if(PI[playerid][Admin] >= 3)
    {
        new id, reason[64], tdstr[256];
        if(sscanf(params, "us[64]", id, reason)) return SCM(playerid, WHITE, "Koristite: /ban [id igraca / deo imena] [reason]");
        if(strlen(reason) > 64) return SCM(playerid, TOMATO, "[RPF] {FFFFFF}Razlog nesme biti veci 64 slova.");
        if(!IsPlayerConnected(id)) return SCM(playerid, TOMATO, "[RPF] {FFFFFF}Taj igrac nije online.");

        SCMF(playerid, TOMATO, "[RPF] {FFFFFF} >> Banovali ste igraca {F3FF02}%s {FFFFFF}| Razlog: {F3FF02}%s {FFFFFF}| Vreme i Datum: {F3FF02}%s", ImeIgraca(id), razlog, TimeDate());

        format(tdstr, sizeof(tdstr), "vase ime: ~g~%s", ImeIgraca(id));
        TextDrawSetString(BanInfo2[id], tdstr);

        format(tdstr, sizeof(tdstr), "ime admina: ~p~%s", ImeIgraca(playerid));
        TextDrawSetString(BanInfo3[id], tdstr);

        format(tdstr, sizeof(tdstr), "razlog iskljucenja: ~r~%s", reason);
        TextDrawSetString(BanInfo4[id], tdstr);

        format(tdstr, sizeof(tdstr), "datum i vreme: ~b~%s", TimeDate());
        TextDrawSetString(BanInfo5[id], tdstr);

        TextDrawShowForPlayer(id, BanInfo0[id]);
        TextDrawShowForPlayer(id, BanInfo1[id]);
        TextDrawShowForPlayer(id, BanInfo2[id]);
        TextDrawShowForPlayer(id, BanInfo3[id]);
        TextDrawShowForPlayer(id, BanInfo4[id]);
        TextDrawShowForPlayer(id, BanInfo5[id]);

        new INI:File = INI_Open(UserPath(id));
        INI_SetTag(File,"data");
        INI_WriteInt(File, "Banovan", 1);
        INI_WriteString(File, "RazlogBana", reason);
        INI_Close(File);

        PI[id][Banovan] = 1;
        format(PI[id][RazlogBana], 50, "%s", reason);
        KikujIgraca(id);
    }
    else return SCM(playerid, TOMATO, "[RPF] {FFFFFF}Nemate ovlastenje za koriscenje ove komande.");
    return 1;
}
Reply
#2

Your code is : /ban [ID] [reason]

And you are typing : /ban 0 bla blabla

Let say that :

0 = ID

bla = reason

blabla = ??

You should be attentive.

Good luck, KillerDVX.
Reply
#3

how can i fix that ?
Reply
#4

The code is fine.

While you are banning someone you should tap :

/ban [ID of player] [reason without spaces].

KillerDVX,
Reply
#5

i just realised that if i type more than 10 letters in reason it wont ban them it only gives This command does not exist, for more commands type /help and it does not matter if its spaced or not
Reply
#6

I would try n help you...
But, I don't speak what ever language that is..so I can't read half of the code
Reply
#7

****** Translate?
Reply
#8

I've fixed it, thanks anyway.

@Prokill911 what is there to translate ? It's all variables strings and formats.

OT. the problem was string leinght, the message that will appear to admin after banning it had too many chars.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)