SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 15/12/2010, 08:51 AM   #1
Face9000
Banned
 
Join Date: Jan 2010
Location: Pigland
Posts: 3,351
Reputation: 190
Default problem with /kick cmd

Hi all,i've 2 problems.

I created /kick cmd,i need add the reason too.

Ex: /kick playerid reason

And,i've my registration system with admin levels.

and the final code is:

Code:
	if(strcmp("/kick", cmdtext, true, 5) == 0)
    {
    if(pInfo[playerid][AdminLevel] > 0)
      if(!strlen(cmdtext[6])){
        return SendClientMessage(playerid, COLOR_RED, "Correct usage: /kick [player id]");
      }
        new targetid = strval(cmdtext[6]);
        if(IsPlayerConnected(targetid)){
          new string[128], playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME];
          GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
          GetPlayerName(targetid, targetname, MAX_PLAYER_NAME);
          format(string, 128, "Admin %s kicked you from the server.", playername);
          SendClientMessage(targetid, COLOR_YELLOW, string);
          Kick(targetid);
          format(string, 128, "Admin %s kicked %s from the server.", playername, targetname);
          SendClientMessageToAll(0xFFAA00AA, string);
        }
        else{
        return SendClientMessage(playerid, 0xFFAA00AA, "That player is not connected.");
        }
    }
    else{
      return SendClientMessage(playerid, 0xFFAA00AA, "No.");
    }
      return 1;
    }
But i got errors:

Code:
C:\Documents and Settings\k\Desktop\SFWAR.pwn(171) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
C:\Documents and Settings\k\Desktop\SFWAR.pwn(171) : warning 215: expression has no effect
C:\Documents and Settings\k\Desktop\SFWAR.pwn(171) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\k\Desktop\SFWAR.pwn(171) : error 029: invalid expression, assumed zero
C:\Documents and Settings\k\Desktop\SFWAR.pwn(171) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
The enum of my registration system is:

Code:
enum pInfo
{
     AdminLevel,
     Cash,
     Score,
}
Thanks.
Face9000 is offline  
Old 15/12/2010, 08:58 AM   #2
Basicz
Gangsta
 
Basicz's Avatar
 
Join Date: Aug 2010
Location: Indonesia, Surabaya.
Posts: 605
Reputation: 35
Default Re: problem with /kick cmd

Umm...

I think the code is like this -
pawn Code:
enum playerInfo
{
     AdminLevel,
     Cash,
     Score,
}
new pInfo[MAX_PLAYERS][playerInfo];
__________________

- Quina, from the game " Final Fantasy IX "
Basicz is offline  
Old 15/12/2010, 09:00 AM   #3
Face9000
Banned
 
Join Date: Jan 2010
Location: Pigland
Posts: 3,351
Reputation: 190
Default Re: problem with /kick cmd

This:

Code:
new PlayerInfo[MAX_PLAYERS][pInfo];
Face9000 is offline  
Old 15/12/2010, 09:05 AM   #4
Basicz
Gangsta
 
Basicz's Avatar
 
Join Date: Aug 2010
Location: Indonesia, Surabaya.
Posts: 605
Reputation: 35
Default Re: problem with /kick cmd

Yep, like that.

EDIT:
If you used the PlayerInfo you showed, change the pInfo to PlayerInfo in your code.
__________________

- Quina, from the game " Final Fantasy IX "
Basicz is offline  
Old 15/12/2010, 09:34 AM   #5
Face9000
Banned
 
Join Date: Jan 2010
Location: Pigland
Posts: 3,351
Reputation: 190
Default Re: problem with /kick cmd

Edit,working.Thanks.

Now i need to add the reason.

Any help?
Face9000 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/kick command problem (dcmd) oliverrud Help Archive 6 21/06/2010 12:58 PM
Kick- / Ban-Problem DeathOnaStick Help Archive 6 05/12/2009 10:29 PM
Kick and ban problem nicu90 Help Archive 3 07/10/2009 02:09 PM
AntiCheat Kick Problem steven_italy Help Archive 2 09/06/2009 11:15 AM


All times are GMT. The time now is 07:46 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.