if(strcmp(cmd,"/kick", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_WHITE,"USAGE: /kick [playerid]"); return 1; } giveplayerid = strval(tmp); if(PlayerInfo[giveplayerid][admin] == 1) { SendClientMessage(playerid,COLOR_BRIGHTRED,"SAC: You cannot kick an admin!"); return 1; } if(PlayerInfo[playerid][admin] == 1) { format(string, sizeof(string),"SAC: Admin %s kicked %s.",PlayerInfo[playerid][name],PlayerInfo[giveplayerid][name]); SendClientMessageToAll(COLOR_BRIGHTRED,string); Kick(giveplayerid); return 1; } return 1; } if(strcmp(cmd,"/ban", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_WHITE,"USAGE: /ban [playerid]"); return 1; } giveplayerid = strval(tmp); if(PlayerInfo[giveplayerid][admin] == 1) { SendClientMessage(playerid,COLOR_BRIGHTRED,"SAC: You cannot ban an admin!"); return 1; } if(PlayerInfo[playerid][admin] == 1) { format(string, sizeof(string),"SAC: Admin %s banned %s.",PlayerInfo[playerid][name],PlayerInfo[giveplayerid][name]); SendClientMessageToAll(COLOR_BRIGHTRED,string); Ban(giveplayerid); return 1; } return 1; }
if(strcmp(cmd,"/kick", true) == 0)
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /kick [playerid]");
giveplayerid = strval(tmp);
if(PlayerInfo[giveplayerid][admin] > 1) return SendClientMessage(playerid,COLOR_BRIGHTRED,"SAC: You cannot kick an admin!");
if(PlayerInfo[playerid][admin] == 1)
{
format(string, sizeof(string),"SAC: Admin %s kicked %s.",PlayerInfo[playerid][name],PlayerInfo[giveplayerid][name]);
SendClientMessageToAll(COLOR_BRIGHTRED,string);
Kick(giveplayerid);
return 1;
}
else return SendClientMessage(playerid,COLOR,"You must be an admin to kick someone!'");
}
if(strcmp(cmd,"/kick", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_WHITE,"USAGE: /kick [playerid]"); return 1; } giveplayerid = strval(tmp); if(PlayerInfo[giveplayerid][admin] == < 1) { SendClientMessage(playerid,COLOR_BRIGHTRED,"SAC: You cannot kick an admin!"); return 1; } if(PlayerInfo[playerid][admin] == > 1) { format(string, sizeof(string),"SAC: Admin %s kicked %s.",PlayerInfo[playerid][name],PlayerInfo[giveplayerid][name]); SendClientMessageToAll(COLOR_BRIGHTRED,string); Kick(giveplayerid); return 1; } return 1; } if(strcmp(cmd,"/ban", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_WHITE,"USAGE: /ban [playerid]"); return 1; } giveplayerid = strval(tmp); if(PlayerInfo[giveplayerid][admin] == < 1) { SendClientMessage(playerid,COLOR_BRIGHTRED,"SAC: You cannot ban an admin!"); return 1; } if(PlayerInfo[playerid][admin] == > 1) { format(string, sizeof(string),"SAC: Admin %s banned %s.",PlayerInfo[playerid][name],PlayerInfo[giveplayerid][name]); SendClientMessageToAll(COLOR_BRIGHTRED,string); Ban(giveplayerid); return 1; } return 1; }
Originally Posted by Memoryz
Код:
if(strcmp(cmd,"/kick", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_WHITE,"USAGE: /kick [playerid]"); return 1; } giveplayerid = strval(tmp); if(PlayerInfo[giveplayerid][admin] == < 1) { SendClientMessage(playerid,COLOR_BRIGHTRED,"SAC: You cannot kick an admin!"); return 1; } if(PlayerInfo[playerid][admin] == > 1) { format(string, sizeof(string),"SAC: Admin %s kicked %s.",PlayerInfo[playerid][name],PlayerInfo[giveplayerid][name]); SendClientMessageToAll(COLOR_BRIGHTRED,string); Kick(giveplayerid); return 1; } return 1; } if(strcmp(cmd,"/ban", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_WHITE,"USAGE: /ban [playerid]"); return 1; } giveplayerid = strval(tmp); if(PlayerInfo[giveplayerid][admin] == < 1) { SendClientMessage(playerid,COLOR_BRIGHTRED,"SAC: You cannot ban an admin!"); return 1; } if(PlayerInfo[playerid][admin] == > 1) { format(string, sizeof(string),"SAC: Admin %s banned %s.",PlayerInfo[playerid][name],PlayerInfo[giveplayerid][name]); SendClientMessageToAll(COLOR_BRIGHTRED,string); Ban(giveplayerid); return 1; } return 1; } |
Originally Posted by silvan
its nearly same..... both uses " Kick(playerid); "
... |