/up command
#1

Hi all! I wanna to make a command for admins which will throw a player on some height. This will detect health hacks. But there is a problem
Код:
C:\DOCUME~1\86A9~1\0016~1\ladmin4.pwn(2841) : error 033: array must be indexed (variable "tmp2")
Full code of command.

Код:
dcmd_up(playerid,params[]) {
	if(PlayerInfo[playerid][LoggedIn] == 1) {
		if(PlayerInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid)) {
		  new tmp[256], tmp2[256], tmp3[256], Index;	tmp = strtok(params,Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index);
		  if(!strlen(params)) return SendClientMessage(playerid, red, " ПРАВКА: /up [playerid ] [height] [reason]");
	  	new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
			player1 = strval(tmp);

		 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) {
				GetPlayerName(player1, playername, sizeof(playername));		GetPlayerName(playerid, adminname, sizeof(adminname));
				CMDMessageToAdmins(playerid,"/up");
		    new Float:x, Float:y, Float:z;
				GetPlayerPos(player1,x,y,z); SetPlayerPos(player1,x,y,z+tmp2); PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(player1,1190,0.0,0.0,0.0);

				if(strlen(tmp3)) {
					format(string,sizeof(string)," Вас подкинул админ %s [причина: %s]",adminname,params[3]);	SendClientMessage(player1,COLOR_RED,string);
					format(string,sizeof(string)," Вы подкинули игрока %s [причина: %s]",playername,params[3]); return SendClientMessage(playerid,COLOR_RED,string);
				} else {
					format(string,sizeof(string)," Вас подкинул админ %s ",adminname);	SendClientMessage(player1,COLOR_RED,string);
					format(string,sizeof(string)," Вы подкинули игрока %s ",playername); return SendClientMessage(playerid,COLOR_RED,string); }
			} else return SendClientMessage(playerid, red, " Нет такого игрока");
		} else return SendClientMessage(playerid,red," ОШИБКА: У вас должен быть 2 уровень чтобы использовать эту команду");
	} else return SendClientMessage(playerid,red," ОШИБКА: Вы должны залогиниться");
}
And line 2841:

Код:
GetPlayerPos(player1,x,y,z); SetPlayerPos(player1,x,y,z+tmp2); PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
Could anybody help?
Reply


Messages In This Thread
/up command - by Butilka - 18.08.2009, 21:09
Re: /up command - by silvan - 18.08.2009, 22:42
Re: /up command - by Butilka - 19.08.2009, 08:06
Re: /up command - by MenaceX^ - 19.08.2009, 08:12
Re: /up command - by Butilka - 19.08.2009, 08:14
Re: /up command - by MenaceX^ - 19.08.2009, 08:28
Re: /up command - by Butilka - 19.08.2009, 08:30
Re: /up command - by MenaceX^ - 19.08.2009, 08:35
Re: /up command - by Butilka - 19.08.2009, 09:35
Re: /up command - by Gamer_Z - 19.08.2009, 10:22

Forum Jump:


Users browsing this thread: 4 Guest(s)