BIG PROBLEM WITH WHIRLPOOL REGISTERSYSTEM!!!
#1

Hi!

I tested the Whirlpool-Registersystem from System64! But now I got a big problem, look at the whole script! Don't worry, I marked the whirlpool-things with comment!

Код:
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(30) : error 017: undefined symbol "INI_String"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(31) : error 017: undefined symbol "INI_Int"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(32) : error 017: undefined symbol "INI_Int"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(33) : error 017: undefined symbol "INI_Int"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(34) : error 017: undefined symbol "INI_Int"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(35) : error 017: undefined symbol "INI_Int"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(36) : error 017: undefined symbol "INI_Int"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(37) : error 017: undefined symbol "INI_Int"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(50) : error 017: undefined symbol "INI_Open"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(50) : warning 213: tag mismatch
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(54) : error 017: undefined symbol "INI_WriteString"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(55) : error 017: undefined symbol "INI_WriteInt"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(56) : error 017: undefined symbol "INI_WriteInt"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(57) : error 017: undefined symbol "INI_WriteInt"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(58) : error 017: undefined symbol "INI_WriteInt"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(59) : error 017: undefined symbol "INI_WriteInt"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(60) : error 017: undefined symbol "INI_WriteInt"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(61) : error 017: undefined symbol "INI_WriteInt"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(63) : error 017: undefined symbol "INI_Close"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(50) : warning 204: symbol is assigned a value that is never used: "playerFile"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(78) : error 017: undefined symbol "INI_ParseFile"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(78) : warning 215: expression has no effect
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(78) : error 029: invalid expression, assumed zero
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(78) : error 017: undefined symbol "extra"
F:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\pawno\include\reglog.inc(78) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


22 Errors.
And now my scriiiipt:


pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT


#include <a_samp>
#include <reglog>
#pragma tabsize 0

#define COL_GREEN2         "{33CC00}" //this is color
#define COL_WHITE          "{FFFFFF}" //this too
#define INI_Exists(%0)  fexist(%0) //just a define, now is a INI_Exists no fexist (I's better for me)

#define DIALOG_REGISTER 1 //define for dialog id
#define DIALOG_LOGIN    2 //define for dialog id
#define USER_FILE       "Users/%s.ini" //define for path where will stats save
#define VERSION         "1.0.0" //version of your mod/server, I just puted it if you wan't to use it, you can use it in example SetGameModeText, main etc. so when you change version on all place where is version will change :D


#define TEAM_GROVE 1
#define TEAM_BALLA 2
#define TEAM_VAGOS 3
#define TEAM_GROVE_COLOR 0x00FF00AA // Bright Green (in RGBA format)
#define TEAM_BALLA_COLOR 0xFF00FFAA // Bright Purple
#define TEAM_VAGOS_COLOR 0xFFFF00AA // Yellow
new gTeam[MAX_PLAYERS];
new KeepNight = 0;
new ServerTime = 24;
new PlayerInfo[MAX_PLAYERS][pInfo]; //variable for stats (I don't now how to expalin it better)
native WP_Hash(buffer[], len, const str[]); //native function for hashing passwords
new naslov2[128], text[128], strText[104]; //some new variables for title, text in dialog and text that player type
new pName[MAX_PLAYER_NAME]; //variable for player name, max.player name is 24




forward LoadUserData(playerid, name[], value[]); //forwarding function LoadUserData

forward Online(); //forwarding our function for online time
public Online() //function for online time
{
    foreach (Player, i) //looping through all player with foreach
    { //opening barrel
        PlayerInfo[i][pOnline] += 1; //this will just increase variable online for 1 more!
    } //closing barrel
    return 1; //returning true
} //closing barrel

enum pInfo enumator for player info
{ //opening barrel
    pPassword[129], //player password
    pKills, //player kills
    pDeaths, //player deaths
    pAdmin, //player admin level
    pMoney, //player money
    pScore, //player score
    pVIP, //player vip level
    pOnline //player online time
} //closing barrel

public LoadUserData(playerid, name[], value[]) //new function with playerid, player name and value
{ //opening barrel
    INI_String("Password", PlayerInfo[playerid][pPassword], 129); //loading player password, Whirlpool hash 128 characters + NULL
    INI_Int("Admin", PlayerInfo[playerid][pAdmin]); //loading player admin level
    INI_Int("VIP", PlayerInfo[playerid][pVIP]); //loading player vip level
    INI_Int("Money", PlayerInfo[playerid][pMoney]); //loading player money
    INI_Int("Score", PlayerInfo[playerid][pScore]); //loading player score
    INI_Int("Kills", PlayerInfo[playerid][pKills]); //loading player kills
    INI_Int("Deaths", PlayerInfo[playerid][pDeaths]); //loading player deaths
    INI_Int("Online", PlayerInfo[playerid][pOnline]); //loading player online time
    return 1; //returning true
} //closing barrel

stock GetName(playerid) //function for getting player name, this is faster than GetPlayerName(I don't mean in miliseconds, just I don't need to create new variable and than use GetPlayerName, I just use this function
{ //opening barrel
   
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME); //getting player name
    return pName //returning player name;
} //closing barrel



public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}


public OnGameModeInit()
{

    SetTimer("Online",60*1000*60,1); //timer for Online time counter :D

    SetNight();
    // Don't use these lines if it's a filterscript
    SetGameModeText("***Live your own life as a GangstA***");
    //ballas
    AddPlayerClass(102, 1974.4895,-1157.0608,20.9505,95.6222, 30, 1000, 29, 1000, 27, 1000); //Ballas1
    AddPlayerClass(103, 1976.7120,-1183.5504,26.0188,98.0542, 22, 1000, 34, 1000, 29, 1000); //Ballas2
    AddPlayerClass(104, 2092.0271,-1166.3419,26.5859,89.4869, 28, 1000, 23, 1000, 4, 1000); //Ballas3
   //grove
    AddPlayerClass(269, 2486.7598,-1647.5186,14.0703,187.5500, 30, 1000, 25, 1000, 24, 1000); //Smoke
    AddPlayerClass(271, 2459.9001,-1688.4135,13.5280,2.9949, 33, 1000, 32, 1000, 31, 1000); //Ryder
    AddPlayerClass(270,2516.3430,-1674.3085,13.9348,81.6422,32,1000,31,1000,34,1000); // Sweet
    AddPlayerClass(0,2495.4890,-1688.2717,13.7022,5.9233,1,0,29,1000,27,1000); // CJ
    AddPlayerClass(105,2451.6484,-1642.4531,13.7357,182.6713,28,1000,33,1000,22,1000); // grove1
    AddPlayerClass(106,2413.7170,-1647.2096,14.0119,174.8622,26,1000,30,1000,23,1000); // grove2
    AddPlayerClass(107,2408.6982,-1674.0126,13.6037,356.5973,34,1000,30,1000,32,1000); // grove3
   //vagos
    AddPlayerClass(108,2571.8352,-1091.2091,66.9639,48.7203,29,1000,9,0,31,1000); // Vagos1
    AddPlayerClass(109,2569.7373,-1088.5804,67.0079,220.8869,22,1000,33,1000,30,1000); // Vagos2
    AddPlayerClass(110,2576.0371,-1070.5568,69.8322,89.5007,27,1000,24,1000,32,1000); // Vagos3



    return 1;
}



forward SetNight();public SetNight()
{
    SetWorldTime(ServerTime);

    if(KeepNight)
    {
        SetTimer("SetNight", 999999999, 0);
    }
}

public OnGameModeExit()
{
    return 1;
}

SetPlayerTeamFromClass(playerid, classid)
{
    if (classid == 0)
    {
        gTeam[playerid] = TEAM_BALLA;
    }
    else if(classid == 1)
    {
        gTeam[playerid] = TEAM_GROVE;
    }
    else if(classid == 2)
    {
        gTeam[playerid] = TEAM_VAGOS;
    }
}

SetPlayerToTeamColor(playerid)
{
    if (gTeam[playerid] == TEAM_GROVE)
    {
        SetPlayerColor(playerid, TEAM_GROVE_COLOR);
    }
    else if (gTeam[playerid] == TEAM_BALLA)
    {
        SetPlayerColor(playerid, TEAM_BALLA_COLOR);
    }
    else if (gTeam[playerid] == TEAM_VAGOS)
    {
        SetPlayerColor(playerid, TEAM_VAGOS_COLOR);
    }
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPVarInt(playerid, "Joined", 1); //setting PVar that player is joined

   switch ( classid )
   {

      case 0..2:
      {
      SetPlayerTeamFromClass(playerid, classid);
      SetPlayerPos(playerid, 1992.1263,-1175.7640,20.1479);
      SetPlayerFacingAngle( playerid, 187.0574 );
      SetPlayerCameraPos(playerid, 1991.3074,-1179.9628,20.0234);
      SetPlayerCameraLookAt(playerid, 1992.1263,-1175.7640,20.1479);
      GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Ballas", 3000, 3);
      }
      case 3..9:
      {
      SetPlayerPos(playerid, 2486.7598,-1647.5186,14.0703);
      SetPlayerFacingAngle( playerid, 187.5500 );
      SetPlayerCameraPos(playerid, 2486.4346,-1646.0953-5,14.0703);
      SetPlayerCameraLookAt(playerid, 2486.7598,-1647.5186,14.0703);
      GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Grove Street", 3000, 3);
      }
      case 10..12:
      {
      SetPlayerPos(playerid, 2571.8352,-1091.2091,66.9639);
      SetPlayerFacingAngle(playerid, 48.7203 );
      SetPlayerCameraPos(playerid, 2570.1152,-1089.5372,66.8601);
      SetPlayerCameraLookAt(playerid, 2571.8352,-1091.2091,66.9639);
      GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Vagos", 3000, 3);
      }
   }

    return 1;
}


OnPlayerRegister(playerid, password[]) //We will use this function when player register, parameters are playerid and password
{ //opening barrel
    new
        hashPassword[129], //variable for hashing password
        uFile[35]; //variable for file

    format(uFile, 35, USER_FILE, GetName(playerid)); //formating our file, where files saves and getting player name

    new
        INI:playerFile = INI_Open(uFile); //creating new ini file called playerFile and opening it

    WP_Hash(hashPassword, 129, password); //hashing password, Whirlpool hash 128 characters + NULL

    INI_WriteString(playerFile, "Password", hashPassword); //writing hashed password
    INI_WriteInt(playerFile, "Admin", 0); //writing player admin level
    INI_WriteInt(playerFile, "VIP", 0); //writing player vip level
    INI_WriteInt(playerFile, "Money", 200); //writing player money
    INI_WriteInt(playerFile, "Score", 0); //writing player score
    INI_WriteInt(playerFile, "Kills", 0); //writing player kills
    INI_WriteInt(playerFile, "Deaths", 0); //writing player deaths
    INI_WriteInt(playerFile, "Online", 0); //writing player online time

    INI_Close(playerFile); //closing file

    SetPVarInt(playerid, "Registered", 1); //setting PVar that player is registered
    SetPVarInt(playerid, "Logged", 1); //setting PVar that player is logged
    return 1; //returning true
} //closing barrel


OnPlayerLogin(playerid, password[]) //we will use this when player login, parameters are playerid and player password
{ //opening barrel
    new
        hashPassword[129], //variable for hashing password
        uFile[35]; //variable for file

    format(uFile, 35, USER_FILE, GetName(playerid)); //formating file, path where it will be saved and getting player name

    INI_ParseFile(uFile, "LoadUserData", .bExtra = true, .extra = playerid); //I don't now what is this xD

    WP_Hash(hashPassword, 129, password); //hashing password, Whirlpool hash 128 characters + NULL

    if(strcmp(PlayerInfo[playerid][pPassword], hashPassword, true)) //if player type true (Right) password he will be logged in
    { //opening barrel
      SetPVarInt(playerid, "Logged", 1); //setting PVar that palyer is logged in
    } //closing barrel
    return 1; //returning true
} //closin barrel

OnPlayerLogout(playerid) //we will use this when player logut, when he disconnect, parameter are only playerid
{ //opening barrel
    new
        uFile[35]; //variable for file

    format(uFile, 35, USER_FILE, GetName(playerid)); //formating file, path where it will be saved and getting player name

   
    INI_WriteInt(playerFile, "Admin", PlayerInfo[playerid][pAdmin]); //writing player admin level
    INI_WriteInt(playerFile, "VIP", PlayerInfo[playerid][pVIP]); //writing player vip level
    INI_WriteInt(playerFile, "Money", GetPlayerMoney(playerid)); //writing player money
    INI_WriteInt(playerFile, "Score", GetPlayerScore(playerid)); //writing player score
    INI_WriteInt(playerFile, "Kills", PlayerInfo[playerid][pKills]); //writing player kills
    INI_WriteInt(playerFile, "Deaths", PlayerInfo[playerid][pDeaths]); //writing player deaths
    INI_WriteInt(playerFile, "Online", PlayerInfo[playerid][pOnline]); //writing player online time

    INI_Close(playerFile); //closing file
    return 1; //returning true
} //closing barrel

public OnPlayerConnect(playerid)
{

    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    OnPlayerLogout(playerid); //saving stats for player

    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(GetPVarInt(playerid, "Joinned") == 1) //if variable is true player will get this
    {
        GivePlayerCash(playerid, PlayerInfo[playerid][pMoney]); //setting player money from file
        SetPlayerScore(playerid, PlayerInfo[playerid][pScore]); //setting player score from file

        SetPVarInt(playerid, "Joinned", 0); //setting PVar taht player is'nt joinned
    }

    SetPlayerToTeamColor(playerid);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][pKills] ++; //incraseing killerid kils for one more
    PlayerInfo[playerid][pDeaths] ++; //increase player deaths for one more
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid) //switching to dialogid
    { //opening barrel
        case DIALOG_REGISTER: //for registering
        { //opening barrel
            if(response)
            { //opening barrel
                new
                    strText[179], naslov2[128]; //some variables for text that player type and title

                if(strlen(inputtext) >= 4 && strlen(inputtext) <= 35) //if player type password more than 4 and less than 35 characters he will get this
                { //opening barrel
                    OnPlayerRegister(playerid, inputtext); //Loading stats

                    format(strText, 125, "You have registered with name {FFFFFF}'%s' {FFFF00}and password {FFFFFF}'%s'{FFFF00}, you are automatic logged in!", GetName(playerid), inputtext); //formating our text
                    SendClientMessage(playerid, COLOR_YELLOW, strText); //send client message
                } //closing barrel
                else // else if je type less than 4 or more than 35 characters he will get this
                { //opening barrel
                    format(naslov2, sizeof(naslov2), ""COL_GREEN2"     Welcome"COL_WHITE" %s!", GetName(playerid)); //formating our title
                    format(strText, 179, ""COL_WHITE"______________________________\n\n"COL_GREEN2"Name"COL_WHITE" %s"COL_GREEN2" isn't registered!\n\n{F81414}Password must be between 4 and 35 characters!", GetName(playerid)); //formating our text
                    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, naslov2, strText, "Register", "Exit"); //show player again dialog for registering
                } //closing barrel
            } //closing barrel
            else Kick(playerid); //if player choose Exit button, server will kick him, this is for response :D
        } //closing barrel

        case DIALOG_LOGIN: //for loging
        { //opening barrel
            if(response)
            { //opening barrel
                new
                    strText[179], naslov2[128]; //some variables for text that player type and title

                if(strlen(inputtext) >= 4 && strlen(inputtext) <= 35) //if player type password more than 4 or less than 35 characters he will get this
                { //opening barrel
                    OnPlayerLogin(playerid, inputtext); //loading stats
                } //closing barrel
                else //but if he type less than 4 or more than 35 characters he will get this
                { //opening barrel
                    format(naslov2, sizeof(naslov2), ""COL_GREEN2"     Welcome"COL_WHITE" %s!", GetName(playerid)); //formating our title
                    format(strText, 179, ""COL_WHITE"______________________________\n\n"COL_GREEN2"Name"COL_WHITE" %s"COL_GREEN2" is registered!\n\n{F81414}You typed wrong password!", GetName(playerid)); //formating our text
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, naslov2, strText, "Login", "Exit"); //showing palyer again dialog for login
                } //closing barrel
            } //closing barrel
            else Kick(playerid); //if he choose Exit button it , server will kick him, this is response :D
        } //closing barrel
    } //closing barrel
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}

 format(strText, 35, USER_FILE, GetName(playerid)); //formating our file, path where it will be saved and getting player name

    if(!INI_Exists(strText)) //if ini doesn't exist player will get this:
    { //opening barrel
        format(naslov2, sizeof(naslov2), ""COL_BLUE2"     Welcome"COL_WHITE" %s!", GetName(playerid)); //formating our title, some text, colors balabalbal
        format(text, sizeof(text), ""COL_WHITE"______________________________\n\n"COL_BLUE2"Name"COL_WHITE" %s"COL_BLUE2" isn't registered!\n\nPlease register!", GetName(playerid)); //formating our text
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, naslov2, text, "Register", "Exit"); //showing player dialog for registering
    } //closing barrel
    else //but if exists player will get this
    { //opening barrel
        format(naslov2, sizeof(naslov2), ""COL_GREEN2"     Welcome"COL_WHITE" %s!", GetName(playerid)); //formating our title, some text, colors...
        format(text, sizeof(text),""COL_WHITE"______________________________\n\n"COL_GREEN2"Name"COL_WHITE" %s"COL_GREEN2" is registered!\n\nPlease login!", GetName(playerid)); //formating our text in dialog
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, naslov2, text, "Login", "Exit"); //showing player dialog for login
    } //closing barrel
SetPVarInt(playerid, "Joinned", 1); //setting PVar that player has joinned




YCMD:setscore(playerid, params[], help) //command for set player score
{ //opening barrel
    #pragma unused help //i won't use help in this command so I need this, if you don't use this you will get warning
    new id,val,string[128], string2[128]; //variables for id of player we want, value and some strings
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3) //detecting if is player admin (rcon) and higher than level 3
    { //opening barrel
        if(sscanf(params,"ui", id, val)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setscore [ID] [Value]"); //parameters are "ui", u is for id and i is for integrer (Number), also we must put after variables! if player don't fill whole parameters he will get message with parameters in that command
        else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID"); //if player isn't online player will get message that player isn't online
        else
        SetPlayerScore(id, val); //setting player score, id that we want and value that we want
        format(string, sizeof(string),"You have set player %s score on %d!",GetName(id), val); //formating message
        SendClientMessage(playerid, COLOR_YELLOW, string); //sending message to admin
        format(string2, sizeof(string2),"Administrator %s has set your score on %d!",GetName(playerid), val); //formating message
        SendClientMessage(id, COLOR_LIME, string2); //sending message to choosed player
    } //closing barrel
    else SendClientMessage(playerid, COLOR_KRED, "You are not authorized for use this command!"); //if player isn't admin he will get that message
    return 1; //returning true
} //closing barrel


YCMD:setkills(playerid, params[], help)
{
    #pragma unused help
    new id,val,string[128], string2[128];
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
    {
        if (sscanf(params,"ui", id, val)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setkills [ID] [Value]");
        else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
        else
        PlayerInfo[id][pKills] = val;
        format(string, sizeof(string),"You have set player %s kills on %d!",GetName(id), val);
        SendClientMessage(playerid, COLOR_YELLOW,string);
        format(string2, sizeof(string2),"Administrator %s has set your kills on %d!",GetName(playerid), val);
        SendClientMessage(id, COLOR_LIME, string2);
    }
    else SendClientMessage(playerid, COLOR_KRED, "You are not authorized for use this command!");
    return 1;
}


YCMD:setdeaths(playerid, params[], help)
{
    #pragma unused help
    new id,val,string[128], string2[128];
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
    {
        if(sscanf(params,"ui", id, val)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setdeaths [ID] [Value]");
        else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
        else
        PlayerInfo[id][pDeaths] = val;
        format(string, sizeof(string),"You have set player %s deaths on %d!",GetName(id), val);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        format(string2, sizeof(string2),"Administrator %s has set your deaths on %d!",GetName(playerid), val);
        SendClientMessage(id, COLOR_LIME, string2);
    }
    else SendClientMessage(playerid, COLOR_KRED, "You are not authorized for use this command!");
    return 1;
}

YCMD:givemoney(playerid, params[], help)
{
    #pragma unused help
    new id, money, string[128], string2[128];
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
    {
        if(sscanf(params, "ui", id, money)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /givemoney [ID] [Amount]");
        else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
        else
        GivePlayerMoney(id, money);
        format(string, sizeof(string), "You have give player %s $%d!", GetName(id), money);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        format(string2, sizeof(string2), "Administrator %s has given you $%d!", GetName(playerid), money);
        SendClientMessage(id, COLOR_LIME, string2);
    }
    else SendClientMessage(playerid, COLOR_KRED, "You are not authorized for use this command!");
    return 1;
}

YCMD:givegun(playerid, params[], help)
{
    #pragma unused help
    new id,weapon,ammo,string[128], string2[128];
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
    {
        if(sscanf(params,"iii",id,weapon,ammo)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /giveweapon [ID] [Gun ID] [Ammo]");
        else if(weapon > 46 || weapon < 1) return SendClientMessage(playerid, COLOR_WHITE, "ID of weapon must be between 1 and 46!");
        else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
        else
        GivePlayerWeapon(id,weapon,ammo);
        format(string, sizeof(string),"You have give player %s weapon %d!", GetName(id), weapon);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        format(string2 ,sizeof(string2),"Administrator %s has given you weapone!", GetName(playerid));
        SendClientMessage(id, COLOR_LIME, string2);
    }
    else SendClientMessage(playerid, COLOR_KRED, "You are not authorized for use this command!");
    return 1;
}

YCMD:setmoney(playerid, params[], help)
{
    #pragma unused help
    new id, cash, string[128], string2[128];
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
    {
        if(sscanf(params,"ui", id, cash)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setmoney [ID] [Amount]");
        else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
        else
        ResetPlayerMoney(id);
        GivePlayerMoney(id, cash);
        format(string, sizeof(string),"You have set player %s money on $%d", GetName(id), cash);
        SendClientMessage(playerid,COLOR_YELLOW,string);
        format(string2, sizeof(string2),"Administrator %s has se your money on $%d", GetName(playerid), cash);
        SendClientMessage(id, COLOR_LIME,string2);
    }
    else SendClientMessage(playerid, COLOR_KRED, "You are not authorized for use this command!");
    return 1;
}

YCMD:makeadmin(playerid, params[], help)
{
    #pragma unused help
    new id, lvl, string[128], string2[128];
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
    {
        if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /makeadmin [ID] [Level]");
        else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
        else if(lvl > 3) return SendClientMessage(playerid, COLOR_WHITE, "Administrator level only can be 1 | 2 | 3");
        else
        PlayerInfo[id][pAdmin] = lvl;
        format(string, sizeof(string), "Administrator %s has set you administrator level on %d!", GetName(playerid), lvl);
        SendClientMessage(id, COLOR_LIME, string);
        format(string2, sizeof(string2), "You have set player %s administrator level on %d!", GetName(id), lvl);
        SendClientMessage(playerid, COLOR_YELLOW, string2);
    }
    else SendClientMessage(playerid, COLOR_KRED, "You are not authorized for use this command!");
    return 1;
}

YCMD:makevip(playerid, params[], help)
{
    #pragma unused help
    new id, lvl, string[128], string2[128];
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
    {
        if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /makevip [ID] [Level]");
        else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
        else if(lvl > 3) return SendClientMessage(playerid, COLOR_WHITE, "VIP level only can be 1 | 2 | 3");
        else
        PlayerInfo[id][pVIP] = lvl;
        format(string, sizeof(string), "Administrator %s has set you VIP level on %d!", GetName(playerid), lvl);
        SendClientMessage(id, COLOR_LIME, string);
        format(string2, sizeof(string2), "You have set player %s VIP level on %d!", GetName(id), lvl);
        SendClientMessage(playerid, COLOR_YELLOW, string2);
    }
    else SendClientMessage(playerid, COLOR_KRED, "You are not authorized for use this command!");
    return 1;
}

YCMD:admins(playerid, params[], help) //command for online admins
{ //opening barrel
    #pragma unused help //in this command I don't use parameter help
    #pragma unused params //alo this
    new aMsg[MAX_PLAYER_NAME]; //varaible for message, smoething like string
    SendClientMessage(playerid, COLOR_KRED, "<~~ Administrators Online ~~>"); //just sends messtog to player
    foreach(Player, i) //looping throught all players (Connected players=
    if(PlayerInfo[i][pAdmin] == 1)f //if is somebody admin level 1 player will get this
    { //opening barrel
        format(aMsg, 127, "Gamemaster: %s", GetName(i)); //formating message
        SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg); //sending message
    } /clossing barrel
    else if(PlayerInfo[i][pAdmin] == 2) //if is somebody admin level 2 player will get this
    {  //opening barrel
        format(aMsg, 127, "Administrator: %s", GetName(i)); //formating message
        SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg); //sending messgage
    } //closing barrel
    else if(PlayerInfo[i][pAdmin] == 3) //iis somebody admin level 3 player will get this
    { //opening barrel
        format(aMsg, 127, "Owner: %s", GetName(i)); //formating message
        SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg); //sending message
    } //closing barrel
    return 1; //returning true
} //closing barrel


YCMD:vip(playerid, params[], help)
{
    #pragma unused help
    #pragma unused params
    new aMsg[MAX_PLAYER_NAME];
    SendClientMessage(playerid, COLOR_KRED, "<~~ VIP Members Online ~~>");
    foreach(Player, i)
    if(PlayerInfo[i][pVIP] == 1)
    {
        format(aMsg, 127, "Bronze: %s", GetName(i));
        SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg);
    }
    else if(PlayerInfo[i][pVIP] == 2)
    {
        format(aMsg, 128, "Silver: %s", GetName(i));
        SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg);
    }
    else if(PlayerInfo[i][pVIP] == 3)
    {
        format(aMsg, 129, "Gold: %s", GetName(i));
        SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg);
    }
    return 1;
}

main( ) { }
Reply
#2

Are you missing an include? It looks like you are.
Reply
#3

you must use the y_ini.inc include
Reply
#4

Hit up Draco Blue son :P I think that's where they have all that crap.
Reply
#5

OK, I made two pics with proof for the includes!!!
Reply
#6

pawn Код:
#include <yini>
Reply
#7

Quote:
Originally Posted by Sil3nc3
Посмотреть сообщение
Hit up Draco Blue son :P I think that's where they have all that crap.
Draco Blue? He's using Whirlpool for hashing.

The compiler isn't reading the functions.

Download - https://sampforum.blast.hk/showthread.php?tid=175565

pawn Код:
#include <YSI\y_ini>
Reply
#8

LOL, oh, I forgot that!^^ THANKS!

But still one error:

Код:
F:\Program Files\Rockstar Games\GTA San Andreas\eigener samp\gamemodes\deathmatch.pwn(8) : fatal error 100: cannot read from file: "yini"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#9

Have you placed the whole YSI folder into your 'pawno > includes' folder?
Reply
#10

Quote:
Originally Posted by samtey
Посмотреть сообщение
LOL, oh, I forgot that!^^ THANKS!

But still one error:

Код:
F:\Program Files\Rockstar Games\GTA San Andreas\eigener samp\gamemodes\deathmatch.pwn(8) : fatal error 100: cannot read from file: "yini"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
The standard name of the file is y_ini not yini!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)