Need help, made a mistake making a command.
#1

Код:
	if (strcmp(cmd, "/spban", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spban(Special Person Ban) [playerid/PartOfName] [reason]");
		return 1;
		}
		if (PlayerInfo[playerid][pAge] == 310518 )
		{
						new year, month,day;
						getdate(year, month, day);
						format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, (result));
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						GetPlayerName(playerid, sendername, sizeof(sendername));
						format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, (result));
						BanLog(string);
						new ip[128];
						GetPlayerIp(giveplayerid,ip,128);
						format(string, sizeof(string), "Banned Player's IP: %s", ip);
						ABroadCast(COLOR_YELLOW,string,1);
						strmid(PlayerInfo[giveplayerid][pBanReason], result, 0, strlen(result), 255);
						PlayerInfo[giveplayerid][pBanned] = 1;
						PlayerInfo[giveplayerid][pBans] += 1;
						Ban(giveplayerid);
						return 1;
					}
				}
			}
			else
			{
				format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
Basically this is supposed to:
If you got The age of: 310518, And you type /spban [user id], Than it should ban that person.

So with this command you dont have to be admin to ban, But you need an sertain Age amouth.


But i dont understand what i did wrong.
Reply


Messages In This Thread
Need help, made a mistake making a command. - by up2u - 10.05.2011, 17:44
Re: Need help, made a mistake making a command. - by o_O - 10.05.2011, 18:36
Re: Need help, made a mistake making a command. - by up2u - 10.05.2011, 18:43
Re: Need help, made a mistake making a command. - by Mean - 10.05.2011, 18:45
Re: Need help, made a mistake making a command. - by o_O - 10.05.2011, 18:46
Re: Need help, made a mistake making a command. - by up2u - 10.05.2011, 18:48
Re: Need help, made a mistake making a command. - by o_O - 10.05.2011, 18:49
Re: Need help, made a mistake making a command. - by up2u - 10.05.2011, 18:54
Re: Need help, made a mistake making a command. - by o_O - 10.05.2011, 19:02
Re: Need help, made a mistake making a command. - by o_O - 10.05.2011, 19:07

Forum Jump:


Users browsing this thread: 1 Guest(s)