Jump to content
  • 0

Question

Posted

Nick:xt3z0ne

Problema:Pai am facut comanda /unban pe nume sa fie doar pentru Un Banner dar cand intru pe sa-mp si scriu /unban spune ca nu am acces dar eu am intrat pe numele care trebe.

Erori / warnings:~

Lini/script:Am facut asa.

[pawn]

#define Un_Banner                                              "Johnny"

[/pawn]

Dupa La Comanda.

[pawn]

COMMAND:unban(playerid,params[])

{

    if(strcmp(pName(playerid), Un_Banner, true) == 0) return SendClientMessage(playerid,0xFF0000FF,"This command is only for UnBanner.");

if(isnull(params)) return SendClientMessage(playerid,0xFF0000FF,"Usage /Unban [Player Name].");

new String[300];

format(String,sizeof(String),"SELECT * FROM Bans WHERE Name = '%s'",params);

DatabaseResult = db_query(Database,String);

if(db_num_rows(DatabaseResult))

{

TB_UnbanPlayerByName(params,playerid);

format(String,sizeof(String),"You unbanned player %s.",params);

SendClientMessage(playerid,0x00FF00FF,String);

}

if(!db_num_rows(DatabaseResult))

{

    SendClientMessage(playerid,0xFF0000FF,"This player isnt banned.");

    db_free_result(DatabaseResult);

    return 1;

}

return 1;

}

[/pawn]

.

Ai incercat sa rezolvi singur ?:Da dar nmk.

Iar comanda originala este asa

[pawn]

COMMAND:unban(playerid,params[])

{

    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000FF,"This command is only for administrators.");

if(isnull(params)) return SendClientMessage(playerid,0xFF0000FF,"Usage /Unban [Player Name].");

new String[300];

format(String,sizeof(String),"SELECT * FROM Bans WHERE Name = '%s'",params);

DatabaseResult = db_query(Database,String);

if(db_num_rows(DatabaseResult))

{

TB_UnbanPlayerByName(params,playerid);

format(String,sizeof(String),"You unbanned player %s.",params);

SendClientMessage(playerid,0x00FF00FF,String);

}

if(!db_num_rows(DatabaseResult))

{

    SendClientMessage(playerid,0xFF0000FF,"This player isnt banned.");

    db_free_result(DatabaseResult);

    return 1;

}

return 1;

}

[/pawn]

Si nu merge...

Sunt un retardat

2 answers to this question

Recommended Posts

  • Administrator
Posted

Adauga inainte de primul if

[pawn]GetPlayerName(playerid, pName, sizeof(pName));[/pawn]

Guest
This topic is now closed to further replies.
×
×
  • 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.