if(strcmp(cmd, "/ban", true) == 0)
{
new string[256];
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USE: /ban [id] [motivo]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][Admin] >= 3)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_RED, "USE: /ban [id] [motivo]");
return 1;
}
format(string, sizeof(string), "{FF0000}%s {FFFFFF}foi banido by: {FF0000}%s {FFFFFF}|| Motivo: {FF0000}%s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_RED, string);
Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), "%d й um ID invбlido.", giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
return 1;
}
if(strcmp(cmd, "/ban", true) == 0)
{
new string[256];
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USE: /ban [id] [motivo]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][Admin] >= 3)
{
if(PlayerInfo[giveplayerid][Admin] > 1) return SendClientMessage(playerid, COLOR_RED, "ERRO: vocк nгo pode banir outro adminstrador!");
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_RED, "USE: /ban [id] [motivo]");
return 1;
}
format(string, sizeof(string), "{FF0000}%s {FFFFFF}foi banido by: {FF0000}%s {FFFFFF}|| Motivo: {FF0000}%s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_RED, string);
Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), "%d й um ID invбlido.", giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
return 1;
}
Cara,Sei quem pode ajudar a voce,o Search,ele e bom nisso...procura que tem um topico pedindo isso.
|
if(PlayerInfo[giveplayerid][Admin] > 1) return SendClientMessage(playerid, COLOR_RED, "ERRO: vocк nгo pode banir outro adminstrador!");
if(PlayerInfo[giveplayerid][Admin] > 0 && PlayerInfo[giveplayerid][Admin] < 5) return SendClientMessage(playerid, COLOR_RED, "ERRO: vocк nгo pode banir outro adminstrador!");
if(PlayerInfo[giveplayerid][Admin] > 0) return SendClientMessage(playerid, COLOR_RED, "ERRO: vocк nгo pode banir outro adminstrador!");
Se for pra falar que eu tenho que usar o search, й bom nгo fazer flood, n00b.
@TOPIC Valeu Garfield |