SA-MP Forums Archive
Help Please What is wrong - 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: Help Please What is wrong (/showthread.php?tid=610925)



Help Please What is wrong - CarRamper - 30.06.2016

Код:
#define MINUTES 10 // 10 Minutes.
#define MILISECONDS MINUTES * 60

new
    RegisterTime[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
 RegisterTime[playerid] = gettime() + MILISECONDS;
return 1; 
}
CMD:register(playerid, params[])
{
    if(RegisterTime[playerid] >= gettime())
    {
        new Str[128]; format(Str, 128, "REGISTER: You are no able to use this command at this point. Wait %d seconds.", RegisterTime[playerid] - gettime());
        return SendClientMessage(playerid, -1, Str);
    }
       new string [ 300 ];
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);

    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));

    format(string, sizeof(string), ""COL_WHITE"{0066FF}BilluGang Cops And Robbers\n\n{999999}New Registration\n{FFFFFF}Nick:{0099FF}%s\n\n{FFFFFF}Do {FF0000}Not {FFFFFF}Register Multiple Accounts\n{FFFFFF}Do {FF0000}Not {FFFFFF}Use The Game Password That You Use Elsewhere\n\nPlease {FFFF66}Enter Your Password {FFFFFF}For Your Account:", pName);
    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"{FFFFFF}CnR {FFFFFF}Registration", string, "Register", "Cancel");
}
What Is Wrong Getting Errors
Код:
C:\Users\Anurag\Desktop\Most Wanted Cops and Robbers v1.1\gamemodes\MWCNR.pwn(5) : error 017: undefined symbol "MAX_PLAYERS"
C:\Users\Anurag\Desktop\Most Wanted Cops and Robbers v1.1\gamemodes\MWCNR.pwn(5) : error 009: invalid array size (negative, zero or out of bounds)
Error Line
Код:
new
    RegisterTime[MAX_PLAYERS];



Re: Help Please What is wrong - nemanjasepa - 30.06.2016

Place on top of your script #define MAX_PLAYERS 50 or #define MAX_PLAYERS 100 or how much you want...


Re: Help Please What is wrong - CarRamper - 30.06.2016

Why 50 or 100 what they do


Re: Help Please What is wrong - GoldenLion - 30.06.2016

Quote:
Originally Posted by CarRamper
Посмотреть сообщение
Why 50 or 100 what they do
Those are the player slots...


Re: Help Please What is wrong - nemanjasepa - 30.06.2016

You can place 1000 if you want...
I just wrote 50 and 100 as example...


Re: Help Please What is wrong - Sithis - 30.06.2016

Did you forget to put
Код:
#include <a_samp>
on top of your script?


Re: Help Please What is wrong - Luicy. - 30.06.2016

Quote:
Originally Posted by Sithis
Посмотреть сообщение
Did you forget to put
Код:
#include <a_samp>
on top of your script?
This got to be a joke? How do you think he'd forget that? Infact, It would had given alot more errors than this.


Re: Help Please What is wrong - SyS - 30.06.2016

You might have also undefined your MAX_PLAYERS but forgot to redefine it.


Re: Help Please What is wrong - Sithis - 30.06.2016

Quote:
Originally Posted by Meller
Посмотреть сообщение
This got to be a joke? How do you think he'd forget that? Infact, It would had given alot more errors than this.
Do I look like a joke to you? I'm just double checking because from the looks of it, this guy has done some basic stuff wrong. But then again, I provided help while you only filled this topic with trash


Re: Help Please What is wrong - Stinged - 30.06.2016

Quote:
Originally Posted by Meller
Посмотреть сообщение
This got to be a joke? How do you think he'd forget that? Infact, It would had given alot more errors than this.
Actually Sithis is probably right.
The error is on the 5th line ('(5)'), and if you could the lines the player posted, you'd find that MAX_PLAYERS is on the 5th line too, so that's his whole script.

Which means, he hasn't included a_samp.