SA-MP Forums Archive
Whats wrong here. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Whats wrong here. (/showthread.php?tid=174232)



Whats wrong here. - [UG]Scripter - 05.09.2010

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;
	}
	}
	}



Re: Whats wrong here. - Venturas - 05.09.2010

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


Re: Whats wrong here. - [UG]Scripter - 05.09.2010

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);


Re: Whats wrong here. - Toni - 05.09.2010

Change Kick(giveplayerid); to Kick(player1);


Re: Whats wrong here. - [UG]Scripter - 05.09.2010

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


Re: Whats wrong here. - Scenario - 05.09.2010

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.


Re: Whats wrong here. - [UG]Scripter - 05.09.2010

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.


Re: Whats wrong here. - Scenario - 05.09.2010

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.