SA-MP Forums Archive
I need help right now please ! - 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)
+--- Thread: I need help right now please ! (/showthread.php?tid=605453)



I need help right now please ! - MarkNelson - 19.04.2016

Hello. i have these errors and warnings in these lines :

Code:
C:\Users\infogenie\Desktop\ME\gamemodes\grandlarc.pwn(532) : error 017: undefined symbol "PlayerInfo"
C:\Users\infogenie\Desktop\ME\gamemodes\grandlarc.pwn(532) : warning 215: expression has no effect
C:\Users\infogenie\Desktop\ME\gamemodes\grandlarc.pwn(532) : error 001: expected token: ";", but found "]"
C:\Users\infogenie\Desktop\ME\gamemodes\grandlarc.pwn(532) : error 029: invalid expression, assumed zero
C:\Users\infogenie\Desktop\ME\gamemodes\grandlarc.pwn(532) : fatal error 107: too many error messages on one line
Code:
if(PlayerInfo[playerid][pAdmin] >= 3){
i hope you to help me right now !


Re: I need help right now please ! - introzen - 19.04.2016

Choose a relevant subject on your thread when posting.

Regarding your problem, do not copy paste scripts into your gamemode as it rarely works.

You have not created the enum containing pAdmin nor the array PlayerInfo itself.


Re: I need help right now please ! - MarkNelson - 19.04.2016

ok ty but how to create the enum and the pAdmin? help please i'm newbie scripter


Re: I need help right now please ! - MarkNelson - 19.04.2016

any help?


Re: I need help right now please ! - Ritzy2K - 19.04.2016

There's probably no enum called "playerinfo", moreover show us a little code above the line which shows the error. Thanks.


Re: I need help right now please ! - MarkNelson - 19.04.2016

ok loook this is all the script :

Code:
   CMD:kick(playerid, params[])
    {
            if(PlayerInfo[playerid][pAdmin] >= 3){
            new PID; //define the playerid we wanna kick
            new reason[64]; //the reason, put into a string
            new str[128]; //a new message string
            new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
            GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
 	  		GetPlayerName(PID, Playername, sizeof(Playername));
            if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_GREYWHITE, "USAGE: /kick [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)

            if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
                return SendClientMessage(playerid, COLOR_GREYWHITE, "Player is not connected!");

            format(str, sizeof(str), "'%s' has been kicked by administrator '%s'. Reason: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
		    SendClientMessageToAll(COLOR_RED, str); //send that message to all
  		    Kick(PID); //kick the playerid we've defined

        }
        else //if he has not got the permissions
        {
            SendClientMessage(playerid, COLOR_GREYWHITE, "You have to be an admin to use that command!"); //return this message


		
return 1;
}



Re: I need help right now please ! - Ritzy2K - 19.04.2016

What is your enum that consist of general player variable called?


Re: I need help right now please ! - MarkNelson - 19.04.2016

i didn't make any enum. tell me how to add that "enum" in my script please fast


Re: I need help right now please ! - Ritzy2K - 19.04.2016

I don't understand, you don't know how to make an enum or whatever. But you're making a kick command, perhaps you ripped this off a tutorial I think. Due to the comments


Re: I need help right now please ! - iKevin - 19.04.2016

Make an enum, like that on top of your script.

Code:
enum pInfo
{
        // other data here
        pAdmin
}
Then make a variable, like this
Code:
new PlayerInfo[MAX_PLAYERS][pInfo];
And it shall work.