I need help with this
#1

Need help with this pawn it has errors this is the register
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <dini>
#include <dudb>

new logged[MAX_PLAYERS];
enum pInfo
{
    AdminLevel,
    cash,
    score,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
    dcmd(register, 8, cmdtext);
    dcmd(login, 5, cmdtext);

#if defined FILTERSCRIPT

#else

main()
{
    print("\n----------------------------------");
    print(" Mike's script");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("V3.C ");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME];
    new file[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/Users/%s.ini",name);
    if(!fexist(file))
    {
    SendClientMessage(playerid, COLOR_GREEN, "OMGWTFBBQ You arent registered! type /register to save your stats!");
    logged[playerid] = 0;
    }
    if(fexist(file))
    {
    SendClientMessage(playerid, COLOR_GREEN, "hot damn sexy! You are registered! type /login [pass]!!");
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new file[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/Users/%s.ini",name);
    if(dini_Exists(file))
    {
  dini_IntSet(file, "score", PlayerInfo[playerid][score]);
  dini_IntSet(file, "money", PlayerInfo[playerid][cash]);
  dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel]);
    }
    logged[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    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;
    }
        dcmd_register(playerid, params[])
{
  new file[128], pname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(file, sizeof(file), "\\Users\\%s.ini", pname);
  if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: /register [password]");
  if(dini_Exists(file)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: You are already registered!");
  dini_Create(file);
  dini_IntSet(file, "hashPW", udb_hash(params));
  dini_Set(file, "password", params);
  dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0);
  dini_IntSet(file, "score", PlayerInfo[playerid][score] = 0);
  dini_IntSet(file, "money", PlayerInfo[playerid][cash] = 500);
  new string[128];
  format(string, 128, "[SYSTEM]: You succesfully registered the nickname %s with password %s", pname, params);
  SendClientMessage(playerid, COLOR_YELLOW, string);
  logged[playerid] = 1;
  SendClientMessage(playerid, COLOR_YELLOW, "[SYSTEM]: You have been automatically logged in!");
  return 1;}

    dcmd_login(playerid, params[])
{
  new file[128];
  new string[MAX_STRING], pname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(file, sizeof(file), "\\Users\\%s.ini", pname);
  if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: /login [password]");
  if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: You are not registered!");
  if(logged[playerid]) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: You are already logged in!");
  new tmp;
  tmp = dini_Int(file, "hashPW");
  if(udb_hash(params) != tmp)
  {
    format(string, 256, "You specified the wrong password for %s!", pname);
    SendClientMessage(playerid, COLOR_RED, string);
  }
  else
  {
    logged[playerid] = 1;
    PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
    SetPlayerScore(playerid, PlayerInfo[playerid][score]);
    new lebel = PlayerInfo[playerid][AdminLevel];
    GivePlayerMoney(playerid, dini_Int(file, "money")-GetPlayerMoney(playerid));
    format(string, 256, "[SYSTEM]: Successfully logged in! (level: %d)!", lebel);
        SendClientMessage(playerid,COLOR_RED, string);
    printf("%s (%i) logged in with password %s", pname, playerid, params);
  }
  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[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
and here the errors


C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(17) : error 010: invalid function or declaration
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(1 : error 025: function heading differs from prototype
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(62) : error 017: undefined symbol "COLOR_GREEN"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(67) : error 017: undefined symbol "COLOR_GREEN"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(120) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(120) : error 017: undefined symbol "dcmd_register"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(121) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(125) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(125) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(126) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(12 : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(129) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(134) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(135) : error 017: undefined symbol "COLOR_YELLOW"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(137) : error 017: undefined symbol "COLOR_YELLOW"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(140) : warning 225: unreachable code
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(140) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(140) : error 017: undefined symbol "dcmd_login"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(141) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(146) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(146) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(147) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(14 : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(151) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(154) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(164) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(164) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(165) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(165) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(16 : warning 225: unreachable code
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(16 : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(305) : warning 203: symbol is never used: "ret_memcpy"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(305) : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


22 Errors.
Reply
#2

'Aight, I had no errors and I think it should work but I haven't tested it so...

And FFS don't use DCMD if you haven't define DCMD!!!
And define your colors before you use them!
And please watch for your indentation, look really ugly.


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

#include <a_samp>
#include <dini>
#include <dudb>

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define COLOR_GREEN     0x00B900FF
#define COLOR_YELLOW    0xFFFF00FF
#define COLOR_RED       0xFF0000FF

new logged[MAX_PLAYERS];
enum pInfo
{
    AdminLevel,
    cash,
    score,
}
new PlayerInfo[MAX_PLAYERS][pInfo];

#if defined FILTERSCRIPT

#else

main()
{
    print("\n----------------------------------");
    print(" Mike's script");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    SetGameModeText("V3.C ");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME];
    new file[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/Users/%s.ini",name);
    if(!fexist(file))
    {
        SendClientMessage(playerid, COLOR_GREEN, "OMGWTFBBQ You arent registered! type /register to save your stats!");
        logged[playerid] = 0;
    }
    if(fexist(file))
    {
        SendClientMessage(playerid, COLOR_GREEN, "hot damn sexy! You are registered! type /login [pass]!!");
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new file[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/Users/%s.ini",name);
    if(dini_Exists(file))
    {
        dini_IntSet(file, "score", PlayerInfo[playerid][score]);
        dini_IntSet(file, "money", PlayerInfo[playerid][cash]);
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel]);
    }
    logged[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

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

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

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(register, 8, cmdtext);
    dcmd(login, 5, cmdtext);
    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[])
{
    return 1;
}

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

dcmd_register(playerid, params[])
{
    new file[128], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "\\Users\\%s.ini", pname);
    if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: /register [password]");
    if(dini_Exists(file)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: You are already registered!");
    dini_Create(file);
    dini_IntSet(file, "hashPW", udb_hash(params));
    dini_Set(file, "password", params);
    dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0);
    dini_IntSet(file, "score", PlayerInfo[playerid][score] = 0);
    dini_IntSet(file, "money", PlayerInfo[playerid][cash] = 500);
    new string[128];
    format(string, 128, "[SYSTEM]: You succesfully registered the nickname %s with password %s", pname, params);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    logged[playerid] = 1;
    SendClientMessage(playerid, COLOR_YELLOW, "[SYSTEM]: You have been automatically logged in!");
    return 1;
}

dcmd_login(playerid, params[])
{
    new file[128];
    new string[MAX_STRING], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "\\Users\\%s.ini", pname);
    if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: /login [password]");
    if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: You are not registered!");
    if(logged[playerid]) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: You are already logged in!");
    new tmp;
    tmp = dini_Int(file, "hashPW");
    if(udb_hash(params) != tmp)
    {
        format(string, 256, "You specified the wrong password for %s!", pname);
        SendClientMessage(playerid, COLOR_RED, string);
    }
    else
    {
        logged[playerid] = 1;
        PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
        SetPlayerScore(playerid, PlayerInfo[playerid][score]);
        new lebel = PlayerInfo[playerid][AdminLevel];
        GivePlayerMoney(playerid, dini_Int(file, "money")-GetPlayerMoney(playerid));
        format(string, 256, "[SYSTEM]: Successfully logged in! (level: %d)!", lebel);
        SendClientMessage(playerid,COLOR_RED, string);
        printf("%s (%i) logged in with password %s", pname, playerid, params);
    }
    return 1;
}
Reply
#3

these are my 2 error

C:\Users\Charles\Desktop\Server\gamemodes\Lol.pwn( 30 : warning 203: symbol is never used: "ret_memcpy"
C:\Users\Charles\Desktop\Server\gamemodes\Lol.pwn( 30 : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Reply
#4

add this
pawn Код:
#pragma unused ret_memcpy
#pragma unused strtok
Reply
#5

Pok it has no errors
Reply
#6

i got more error here the pawn and errors
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
//#include <dini>
//#include <dudb>
new logged[MAX_PLAYERS];
enum pInfo
{
    AdminLevel,
    cash,
    score,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
#define color 0x00FFFFAA
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COL_EASY           "{FFF1AF}"
#define COLOR_YELLOW 0xFFFF00AA
#define COL_WHITE          "{FFFFFF}"
#define COL_BLACK          "{0E0101}"
#define COL_GREY           "{C3C3C3}"
#define COL_GREEN          "{6EF83C}"
#define COL_RED            "{F81414}"
#define COL_YELLOW         "{F3FF02}"
#define COL_ORANGE         "{FFAF00}"
#define COL_LIME           "{B7FF00}"
#define COL_CYAN           "{00FFEE}"
#define COL_LIGHTBLUE      "{00C0FF}"
#define COL_BLUE           "{0049FF}"
#define COL_MAGENTA        "{F300FF}"
#define COL_VIOLET         "{B700FF}"
#define COL_PINK           "{FF00EA}"
#define COL_MARONE         "{A90202}"
#define COL_CMD            "{B8FF02}"
#define COL_PARAM          "{3FCD02}"
#define COL_SERVER         "{AFE7FF}"
#define COL_VALUE          "{A3E4FF}"
#define COL_RULE           "{F9E8B7}"
#define COL_RULE2          "{FBDF89}"
#define COL_RWHITE         "{FFFFFF}"
#define COL_LGREEN         "{C9FFAB}"
#define COL_LRED           "{FFA1A1}"
#define COL_LRED2          "{C77D87}"
#define MAKE_COLOUR(%0,%1,%2) ((((%0) & 0xFF) << 16) | (((%1) & 0xFF) << 8) | (((%2) & 0xFF) << 0))
#define MAKE_COLOUR_AA(%0,%1,%2) ((((%0) & 0xFF) << 24) | (((%1) & 0xFF) << 16) | (((%2) & 0xFF) << 8) | 0xAA)
#define MAKE_COLOUR_ALPHA(%0,%1,%2,%3) ((((%0) & 0xFF) << 24) | (((%1) & 0xFF) << 16) | (((%2) & 0xFF) << 8) | (((%3) & 0xFF) << 0))

#define COLOUR_RED         MAKE_COLOUR(255, 0, 0)
#define COLOUR_GREEN       MAKE_COLOUR(0, 255, 0)
#define COLOUR_BLUE        MAKE_COLOUR(0, 0, 255)

#define COLOUR_CYAN_AA     MAKE_COLOUR_AA(0, 255, 255)
#define COLOUR_MAGENTA_AA  MAKE_COLOUR_AA(255, 0, 255)
#define COLOUR_YELLOW_AA   MAKE_COLOUR_AA(255, 255, 0)

#define BLACK_ALPHA        MAKE_COLOUR_ALPHA(0, 0, 0, 170) // 170 == 0xAA
#define WHITE_ALPHA        MAKE_COLOUR_ALPHA(255, 255, 255, 255)



main()
{
    print("\n----------------------------------");
    print(" Airlines by Tom");
    print("----------------------------------\n");
}


public OnGameModeInit()
{
    // Misc
    SetGameModeText("Airlines");
    //Class
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    //Cars
    AddStaticVehicle(608,1879.2600,-2401.2256,14.0886,1.5656,1,1); // stairs 1
    AddStaticVehicle(608,1877.2349,-2401.3079,14.0823,357.6205,1,1); // stair 2
    AddStaticVehicle(608,1869.9978,-2400.7791,14.0860,354.5709,1,1); // stair 3
    AddStaticVehicle(608,1875.4689,-2401.2971,14.0867,357.9840,1,1); // stair 4
    AddStaticVehicle(608,1872.5348,-2400.9446,14.0839,353.2430,1,1); // stair 5
    AddStaticVehicle(416,1934.6772,-2248.0476,13.6993,173.8238,1,3); // ambulance 1
    AddStaticVehicle(416,1930.0858,-2247.5081,13.6957,179.7971,1,3); // ambulance 2
    AddStaticVehicle(416,1926.1385,-2248.2830,13.6958,179.2902,1,3); // ambulance 3
    AddStaticVehicle(416,1921.3673,-2247.7832,13.6993,178.9306,1,3); // ambulance 4
    AddStaticVehicle(416,1917.3853,-2248.1794,13.6963,184.1634,1,3); // ambulance 5
    AddStaticVehicle(416,1913.4570,-2247.9443,13.6957,181.8982,1,3); // ambulance 6
    AddStaticVehicle(416,1909.3033,-2247.8630,13.6962,184.9742,1,3); // ambulance 7
    AddStaticVehicle(416,1905.6031,-2247.8091,13.6963,184.8825,1,3); // ambulance 8
    AddStaticVehicle(544,1995.3147,-2297.1028,13.7820,91.8021,3,1); // firetruck 1
    AddStaticVehicle(544,1994.8412,-2300.7241,13.7839,91.2975,3,1); // firetruck 2
    AddStaticVehicle(544,1994.7474,-2304.2795,13.7824,93.3867,3,1); // firetruck 3
    AddStaticVehicle(544,1994.6123,-2308.0220,13.7811,91.8051,3,1); // firetruck 4
    AddStaticVehicle(544,1994.5581,-2311.3313,13.7827,90.3123,3,1); // firetruck 5
    AddStaticVehicle(544,1994.7583,-2314.8208,13.7827,88.3501,3,1); // firetruck 6

    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME];
    new file[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/Users/%s.ini",name);
    if(!fexist(file))
    {
        SendClientMessage(playerid, COLOR_GREEN, "OMGWTFBBQ You arent registered! type /register to save your stats!");
        logged[playerid] = 0;
    }
    if(fexist(file))
    {
        SendClientMessage(playerid, COLOR_GREEN, "hot damn sexy! You are registered! type /login [pass]!!");
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
      new file[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/Users/%s.ini",name);
    if(dini_Exists(file))
    {
        dini_IntSet(file, "score", PlayerInfo[playerid][score]);
        dini_IntSet(file, "money", PlayerInfo[playerid][cash]);
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel]);
    }
    logged[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

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

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

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(register, 8, cmdtext);
    dcmd(login, 5, cmdtext);
   
    if (strcmp("/afk", cmdtext, true) == 0)
    {
        new pName[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string, sizeof(string), "--> %s is AFK.", pName);
        SendClientMessageToAll(COLOR_YELLOW, string);
        TogglePlayerControllable(playerid, 0);
        SetPlayerHealth(playerid, 999999999.99);
        return 1;
    }
    if(strcmp("/back", cmdtext, true) == 0)
    {
        new pName[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string, sizeof(string), "--> %s is now back.", pName);
        SendClientMessageToAll(COLOR_YELLOW, string);
        TogglePlayerControllable(playerid, 1);
        SetPlayerHealth(playerid, 100);
        return 1;
    }
    if (strcmp("/lv", cmdtext, true, 10) == 0) //<--- This and the SetPlayerPos will make you teleport to Las Venturas for Example.
    {
        SetPlayerPos(playerid, 1282.6499,1267.8385,10.8203);
        // Now If you want to show a message you put this:
        SendClientMessage(playerid,color,"You have teleport to Las Ventura");
        //Sometimes you need a Virtual World Numberfor some interiors. When you for example want to teleport to an Original Interior of SanAndreas, you should follow the Command this:
        SetPlayerInterior(playerid, 0);
        return 1;
    }
    if (strcmp("/sf", cmdtext, true, 10) == 0) //<--- This and the SetPlayerPos will make you teleport to Las Venturas for Example.
    {
        SetPlayerPos(playerid, -1645.2598,-201.1026,13.9188);
        // Now If you want to show a message you put this:
        SendClientMessage(playerid,color,"You have teleport to San Ferro");
        //Sometimes you need a Virtual World Numberfor some interiors. When you for example want to teleport to an Original Interior of SanAndreas, you should follow the Command this:
        SetPlayerInterior(playerid,0);
        return 1;
    }
    if (strcmp("/ls", cmdtext, true, 10) == 0) //<--- This and the SetPlayerPos will make you teleport to Las Venturas for Example.
    {
        SetPlayerPos(playerid, 1527.3297,-2455.9033,13.5547);
        // Now If you want to show a message you put this:
        SendClientMessage(playerid,color,"You have teleport to Los Santos");
        //Sometimes you need a Virtual World Numberfor some interiors. When you for example want to teleport to an Original Interior of SanAndreas, you should follow the Command this:
        SetPlayerInterior(playerid,0);
        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[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
errors
C:\Users\Charles\Desktop\Server\gamemodes\Mike.pwn (121) : error 017: undefined symbol "COLOR_GREEN"
C:\Users\Charles\Desktop\Server\gamemodes\Mike.pwn (126) : error 017: undefined symbol "COLOR_GREEN"
C:\Users\Charles\Desktop\Server\gamemodes\Mike.pwn (134) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Mike.pwn (137) : error 017: undefined symbol "dini_Exists"
C:\Users\Charles\Desktop\Server\gamemodes\Mike.pwn (139) : error 017: undefined symbol "dini_IntSet"
C:\Users\Charles\Desktop\Server\gamemodes\Mike.pwn (140) : error 017: undefined symbol "dini_IntSet"
C:\Users\Charles\Desktop\Server\gamemodes\Mike.pwn (141) : error 017: undefined symbol "dini_IntSet"
C:\Users\Charles\Desktop\Server\gamemodes\Mike.pwn (174) : error 017: undefined symbol "dcmd_register"
C:\Users\Charles\Desktop\Server\gamemodes\Mike.pwn (175) : error 017: undefined symbol "dcmd_login"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Reply
#7

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

#include <a_samp>
#include <dini>
#include <dudb>

new logged[MAX_PLAYERS];
enum pInfo
{
    AdminLevel,
    cash,
    score,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
#define color 0x00FFFFAA
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COL_EASY           "{FFF1AF}"
#define COLOR_YELLOW 0xFFFF00AA
#define COL_WHITE          "{FFFFFF}"
#define COL_BLACK          "{0E0101}"
#define COL_GREY           "{C3C3C3}"
#define COL_GREEN          "{6EF83C}"
#define COL_RED            "{F81414}"
#define COL_YELLOW         "{F3FF02}"
#define COL_ORANGE         "{FFAF00}"
#define COL_LIME           "{B7FF00}"
#define COL_CYAN           "{00FFEE}"
#define COL_LIGHTBLUE      "{00C0FF}"
#define COL_BLUE           "{0049FF}"
#define COL_MAGENTA        "{F300FF}"
#define COL_VIOLET         "{B700FF}"
#define COL_PINK           "{FF00EA}"
#define COL_MARONE         "{A90202}"
#define COL_CMD            "{B8FF02}"
#define COL_PARAM          "{3FCD02}"
#define COL_SERVER         "{AFE7FF}"
#define COL_VALUE          "{A3E4FF}"
#define COL_RULE           "{F9E8B7}"
#define COL_RULE2          "{FBDF89}"
#define COL_RWHITE         "{FFFFFF}"
#define COL_LGREEN         "{C9FFAB}"
#define COL_LRED           "{FFA1A1}"
#define COL_LRED2          "{C77D87}"
#define MAKE_COLOUR(%0,%1,%2) ((((%0) & 0xFF) << 16) | (((%1) & 0xFF) << 8) | (((%2) & 0xFF) << 0))
#define MAKE_COLOUR_AA(%0,%1,%2) ((((%0) & 0xFF) << 24) | (((%1) & 0xFF) << 16) | (((%2) & 0xFF) << 8) | 0xAA)
#define MAKE_COLOUR_ALPHA(%0,%1,%2,%3) ((((%0) & 0xFF) << 24) | (((%1) & 0xFF) << 16) | (((%2) & 0xFF) << 8) | (((%3) & 0xFF) << 0))

#define COLOUR_RED         MAKE_COLOUR(255, 0, 0)
#define COLOUR_GREEN       MAKE_COLOUR(0, 255, 0)
#define COLOUR_BLUE        MAKE_COLOUR(0, 0, 255)
#define COLOR_RED           0xAA3333AA

#define COLOUR_CYAN_AA     MAKE_COLOUR_AA(0, 255, 255)
#define COLOUR_MAGENTA_AA  MAKE_COLOUR_AA(255, 0, 255)
#define COLOUR_YELLOW_AA   MAKE_COLOUR_AA(255, 255, 0)

#define BLACK_ALPHA        MAKE_COLOUR_ALPHA(0, 0, 0, 170) // 170 == 0xAA
#define WHITE_ALPHA        MAKE_COLOUR_ALPHA(255, 255, 255, 255)



main()
{
    print("\n----------------------------------");
    print(" Airlines by Tom");
    print("----------------------------------\n");
}


public OnGameModeInit()
{
    // Misc
    SetGameModeText("Airlines");
    //Class
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    //Cars
    AddStaticVehicle(608,1879.2600,-2401.2256,14.0886,1.5656,1,1); // stairs 1
    AddStaticVehicle(608,1877.2349,-2401.3079,14.0823,357.6205,1,1); // stair 2
    AddStaticVehicle(608,1869.9978,-2400.7791,14.0860,354.5709,1,1); // stair 3
    AddStaticVehicle(608,1875.4689,-2401.2971,14.0867,357.9840,1,1); // stair 4
    AddStaticVehicle(608,1872.5348,-2400.9446,14.0839,353.2430,1,1); // stair 5
    AddStaticVehicle(416,1934.6772,-2248.0476,13.6993,173.8238,1,3); // ambulance 1
    AddStaticVehicle(416,1930.0858,-2247.5081,13.6957,179.7971,1,3); // ambulance 2
    AddStaticVehicle(416,1926.1385,-2248.2830,13.6958,179.2902,1,3); // ambulance 3
    AddStaticVehicle(416,1921.3673,-2247.7832,13.6993,178.9306,1,3); // ambulance 4
    AddStaticVehicle(416,1917.3853,-2248.1794,13.6963,184.1634,1,3); // ambulance 5
    AddStaticVehicle(416,1913.4570,-2247.9443,13.6957,181.8982,1,3); // ambulance 6
    AddStaticVehicle(416,1909.3033,-2247.8630,13.6962,184.9742,1,3); // ambulance 7
    AddStaticVehicle(416,1905.6031,-2247.8091,13.6963,184.8825,1,3); // ambulance 8
    AddStaticVehicle(544,1995.3147,-2297.1028,13.7820,91.8021,3,1); // firetruck 1
    AddStaticVehicle(544,1994.8412,-2300.7241,13.7839,91.2975,3,1); // firetruck 2
    AddStaticVehicle(544,1994.7474,-2304.2795,13.7824,93.3867,3,1); // firetruck 3
    AddStaticVehicle(544,1994.6123,-2308.0220,13.7811,91.8051,3,1); // firetruck 4
    AddStaticVehicle(544,1994.5581,-2311.3313,13.7827,90.3123,3,1); // firetruck 5
    AddStaticVehicle(544,1994.7583,-2314.8208,13.7827,88.3501,3,1); // firetruck 6

    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME];
    new file[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/Users/%s.ini",name);
    if(!fexist(file))
    {
        SendClientMessage(playerid, COLOR_GREEN, "OMGWTFBBQ You arent registered! type /register to save your stats!");
        logged[playerid] = 0;
    }
    if(fexist(file))
    {
        SendClientMessage(playerid, COLOR_GREEN, "hot damn sexy! You are registered! type /login [pass]!!");
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new file[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/Users/%s.ini",name);
    if(dini_Exists(file))
    {
        dini_IntSet(file, "score", PlayerInfo[playerid][score]);
        dini_IntSet(file, "money", PlayerInfo[playerid][cash]);
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel]);
    }
    logged[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    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("/afk", cmdtext, true) == 0)
    {
        new pName[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string, sizeof(string), "--> %s is AFK.", pName);
        SendClientMessageToAll(COLOR_YELLOW, string);
        TogglePlayerControllable(playerid, 0);
        SetPlayerHealth(playerid, 999999999.99);
        return 1;
    }
    if(strcmp("/back", cmdtext, true) == 0)
    {
        new pName[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string, sizeof(string), "--> %s is now back.", pName);
        SendClientMessageToAll(COLOR_YELLOW, string);
        TogglePlayerControllable(playerid, 1);
        SetPlayerHealth(playerid, 100);
        return 1;
    }
    if (strcmp("/lv", cmdtext, true, 10) == 0) //<--- This and the SetPlayerPos will make you teleport to Las Venturas for Example.
    {
        SetPlayerPos(playerid, 1282.6499,1267.8385,10.8203);
        // Now If you want to show a message you put this:
        SendClientMessage(playerid,color,"You have teleport to Las Ventura");
        //Sometimes you need a Virtual World Numberfor some interiors. When you for example want to teleport to an Original Interior of SanAndreas, you should follow the Command this:
        SetPlayerInterior(playerid, 0);
        return 1;
    }
    if (strcmp("/sf", cmdtext, true, 10) == 0) //<--- This and the SetPlayerPos will make you teleport to Las Venturas for Example.
    {
        SetPlayerPos(playerid, -1645.2598,-201.1026,13.9188);
        // Now If you want to show a message you put this:
        SendClientMessage(playerid,color,"You have teleport to San Ferro");
        //Sometimes you need a Virtual World Numberfor some interiors. When you for example want to teleport to an Original Interior of SanAndreas, you should follow the Command this:
        SetPlayerInterior(playerid,0);
        return 1;
    }
    if (strcmp("/ls", cmdtext, true, 10) == 0) //<--- This and the SetPlayerPos will make you teleport to Las Venturas for Example.
    {
        SetPlayerPos(playerid, 1527.3297,-2455.9033,13.5547);
        // Now If you want to show a message you put this:
        SendClientMessage(playerid,color,"You have teleport to Los Santos");
        //Sometimes you need a Virtual World Numberfor some interiors. When you for example want to teleport to an Original Interior of SanAndreas, you should follow the Command this:
        SetPlayerInterior(playerid,0);
        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[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
Make sure you have Dini.
Reply
#8

i have 2 more errors
: error 017: undefined symbol "COLOR_GREEN"
: error 017: undefined symbol "COLOR_GREEN"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Reply
#9

add this
pawn Код:
#define COLOR_GREEN         0x33AA33AA
in your defines
Reply
#10

has no rorrs thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)