Whats wrong here.
#1

Okay, So something is fucked.

It just kicks the player who sent the command. Or playerid 0.


Код:
	if (strcmp(cmdtext,"/kick", true, 5) == 0)
 	{
	if(PlayerInfo[playerid][pAdminLevel] == 0) return SendClientMessage(playerid,COLOR_RED,"Your Not an Admin and cant use this");
    if(PlayerInfo[playerid][pAdminLevel] != 0)
    {
    new tmp[256], tmp2[256];
	new giveplayerid;
 	new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
	player1 = strval(tmp);
	GetPlayerName(player1, playername, sizeof(playername));
	GetPlayerName(playerid, adminname, sizeof(adminname));
	if(!strlen(tmp2)) {
	format(string,sizeof(string),"%s has been kicked by Administrator %s [no reason given] ",playername,adminname); SendClientMessageToAll(COLOR_YELLOW,string);
	Kick(giveplayerid);
	return 1;
	}
	}
	}
Reply
#2

Well, all you did was define giveplayerid as a variable, nothing else.
Reply
#3

I did just try and define it as;

new giveplayerid[MAX_PLAYERS]; and was greated by a friendly error.

G:\Users\Bradley\Desktop\SAMP\filterscripts\reg.pw n(207) : error 035: argument type mismatch (argument 1)

Kick(giveplayerid);
Reply
#4

Change Kick(giveplayerid); to Kick(player1);
Reply
#5

Thanks, Toni. I guess this is the price you pay for scripting your own admin system xD
Reply
#6

Quote:
Originally Posted by [UG]Scripter
Посмотреть сообщение
Thanks, Toni. I guess this is the price you pay for scripting your own admin system xD
No. Scripting your own things is a lot better then ripping it out of peoples GM's. You learn from you're mistakes and also remember that "practice makes perfect"! Good luck on your admin system, bro.
Reply
#7

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
No. Scripting your own things is a lot better then ripping it out of peoples GM's. You learn from you're mistakes and also remember that "practice makes perfect"! Good luck on your admin system, bro.
Thanks Man, Means alot. I'm just so sick of seeing the same damn Shit everywhere. Plus, as you said. You learn from your mistakes. Ripping it from someone else's game mode is only cheating yourself out of the knowledge that you could have gained.
Reply
#8

Quote:
Originally Posted by [UG]Scripter
Посмотреть сообщение
Thanks Man, Means alot. I'm just so sick of seeing the same damn Shit everywhere. Plus, as you said. You learn from your mistakes. Ripping it from someone else's game mode is only cheating yourself out of the knowledge that you could have gained.
Well said my friend, well said.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)