Compiler ERROR
#1

Code:
Please check out our new and improved Firefox Add-on. hide message
By Correct it please on the 23rd of Nov 2010 08:38:47 AM Download | Raw | Embed | Report | Delete

   1.
      // This is a comment
   2.
      // uncomment the line below if you want to write a filterscript
   3.
      //#define FILTERSCRIPT
   4.
       
   5.
      #include <a_samp>
   6.
      #include <core>
   7.
      #include <float>
   8.
      #include <string>
   9.
      #include <file>
  10.
      #include <time>
  11.
      #include <datagram>
  12.
      #include <a_players>
  13.
      #include <a_vehicles>
  14.
      #include <a_objects>
  15.
      #include <a_sampdb>
  16.
      #include <dini>
  17.
       
  18.
      #if defined FILTERSCRIPT
  19.
       
  20.
      public OnFilterScriptInit()
  21.
      {
  22.
              print("\n--------------------------------------");
  23.
              print(" [BWS]DM by [BWS]ZheFoxy");
  24.
              print("--------------------------------------\n");
  25.
              return 1;
  26.
      }
  27.
       
  28.
      public OnFilterScriptExit()
  29.
      {
  30.
              return 1;
  31.
      }
  32.
       
  33.
      #else
  34.
       
  35.
      main()
  36.
      {
  37.
              print("\n----------------------------------");
  38.
              print(" [BWS]DM by [BWS]ZheFoxy");
  39.
              print("----------------------------------\n");
  40.
      }
  41.
       
  42.
      #endif
  43.
       
  44.
      public OnGameModeInit()
  45.
      {
  46.
              // Don't use these lines if it's a filterscript
  47.
              SetGameModeText("DeathMatch");
  48.
              AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 26, 8000, 28, 8000, 0, 0);
  49.
              AddStaticVehicle(522,2513.5706,2389.7922,10.3940,267.9746,36,105);
  50.
              AddPlayerClass(0,2113.8882,1927.3894,10.8203,358.1300,26,8000,28,8000,0,0);
  51.
              AddPlayerClass(230,2461.4231,2267.8325,91.6300,185.5897,26,8000,28,8000,0,0);
  52.
              AddPlayerClass(293,2402.6985,2415.0161,10.6797,224.1306,26,8000,28,8000,0,0);
  53.
              AddStaticVehicle(451,2040.0520,1319.2751,10.3913,183.2436,16,16);
  54.
              AddStaticVehicle(429,2040.5259,1359.2792,10.3497,177.1879,13,13);
  55.
              AddStaticVehicle(411,2040.2279,1344.4128,10.4076,3.5436,126,54);
  56.
              AddStaticVehicle(522,2040.1927,1336.5278,10.2416,355.6628,7,79);
  57.
              AddPlayerClass(293,2075.7346,1511.8411,10.6719,178.0210,26,0,0,0,0,0);
  58.
          AddStaticVehicleEx(541,1559.8295,-2338.4761,13.1874,271.4546,0,6,30000); // car 1
  59.
          AddStaticVehicleEx(589,1559.8136,-2331.7449,13.1871,268.5542,0,6,30000); // car 3
  60.
          AddStaticVehicleEx(400,1560.0394,-2335.1580,13.1859,267.9830,0,6,30000); // car 2
  61.
          AddStaticVehicleEx(554,1560.0558,-2328.5540,13.1862,271.7626,0,6,30000); // car 4
  62.
          AddStaticVehicleEx(565,1560.3300,-2325.2305,13.1878,270.5352,0,6,30000); // car 5
  63.
          AddStaticVehicleEx(451,1560.5098,-2315.2676,13.1874,269.1917,0,6,30000); // car 6
  64.
          AddStaticVehicleEx(444,1546.2843,-2361.3855,13.1943,180.4433,0,6,30000); // car 5
  65.
          AddStaticVehicle(589,1671.1375,-2313.5847,13.1431,89.7754,0,6); // // Public car
  66.
          AddStaticVehicle(400,1691.4199,-2313.5417,13.2360,92.2966,0,6); // Public car 2
  67.
          AddStaticVehicle(541,1702.2924,-2313.6370,13.5459,90.6240,0,6); // //public car 3
  68.
          AddStaticVehicle(554,1710.5486,-2313.4878,13.5423,91.4031,0,6); // //public car 4
  69.
          CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
  70.
       
  71.
       
  72.
       
  73.
              return 1;
  74.
      }
  75.
       
  76.
      public OnGameModeExit()
  77.
      {
  78.
              return 1;
  79.
      }
  80.
       
  81.
      public OnPlayerRequestClass(playerid, classid)
  82.
      {
  83.
              SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  84.
              SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  85.
              SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  86.
              SetPlayerPos(playerid,2096.0981,2189.2546,16.3711);
  87.
          SetPlayerPos(playerid, 0.6574,27.6034,1199.5938);
  88.
         
  89.
       
  90.
             
  91.
              return 1;
  92.
      }
  93.
       
  94.
      public OnPlayerConnect(playerid)
  95.
      {
  96.
              return 1;
  97.
      }
  98.
       
  99.
      public OnPlayerDisconnect(playerid, reason)
 100.
      {
 101.
              return 1;
 102.
      }
 103.
       
 104.
      public OnPlayerSpawn(playerid)
 105.
      {
 106.
              return 1;
 107.
      }
 108.
       
 109.
      public OnPlayerDeath(playerid, killerid, reason)
 110.
      {
 111.
          GivePlayerMoney(playerid, -5000);
 112.
          return 1;
 113.
      }
 114.
       
 115.
      public OnVehicleSpawn(vehicleid)
 116.
      {
 117.
              return 1;
 118.
      }
 119.
       
 120.
      public OnVehicleDeath(vehicleid, killerid)
 121.
      {
 122.
              return 1;
 123.
      }
 124.
       
 125.
      public OnPlayerText(playerid, text[])
 126.
      {
 127.
              return 1;
 128.
      }
 129.
       
 130.
       
 131.
      public OnPlayerCommandText(playerid, cmdtext[])
 132.
      {
 133.
          if (strcmp("/heal", cmdtext, true, 10) == 0)
 134.
          {
 135.
              SetPlayerHealth(playerid,200);// Set player hp to 200...
 136.
              return 1;
 137.
          }
 138.
          if (strcmp("/kill", cmdtext, true, 10) == 0)
 139.
          {
 140.
              SetPlayerHealth(playerid,0);// Set player hp to 0...kill the player
 141.
              return 1;
 142.
          }
 143.
       
 144.
          if (strcmp("/sawnoff", cmdtext, true, 10) == 0)
 145.
          {
 146.
              GivePlayerWeapon(playerid,26,8000);
 147.
              return 1;
 148.
          }
 149.
       
 150.
          if (strcmp("/uzi", cmdtext, true, 10) == 0)
 151.
          {
 152.
              GivePlayerWeapon(playerid,28,8000);
 153.
              return 1;
 154.
          }
 155.
       
 156.
          if (strcmp("/deagle", cmdtext, true, 10) == 0)
 157.
          {
 158.
              GivePlayerWeapon(playerid,24,8000);
 159.
              return 1;
 160.
          }
 161.
       
 162.
          if (strcmp("/shotgun", cmdtext, true, 10) == 0)
 163.
          {
 164.
              GivePlayerWeapon(playerid,25,8000);
 165.
              return 1;
 166.
          }
 167.
       
 168.
          if (strcmp("/sniper", cmdtext, true, 10) == 0)
 169.
          {
 170.
              GivePlayerWeapon(playerid,34,8000);
 171.
              return 1;
 172.
          }
 173.
       
 174.
          if (strcmp("/spas", cmdtext, true, 10) == 0)
 175.
          {
 176.
              GivePlayerWeapon(playerid,27,8000);
 177.
              return 1;
 178.
       
 179.
          }
 180.
       
 181.
          if (strcmp("/armor", cmdtext, true, 10) == 0)
 182.
          {
 183.
             SetPlayerArmour(playerid, 200);
 184.
             return 1;
 185.
          }
 186.
       
 187.
          if (strcmp("/s 18", cmdtext, true) == 0)
 188.
          {
 189.
             SetPlayerSkin(playerid, 18);
 190.
             return 1;
 191.
          }
 192.
       
 193.
          if (strcmp("/s 293", cmdtext, true) == 0)
 194.
          {
 195.
             SetPlayerSkin(playerid, 293);
 196.
             return 1;
 197.
          }
 198.
       
 199.
          if (strcmp("/s 134", cmdtext, true) == 0)
 200.
          {
 201.
             SetPlayerSkin(playerid, 134);
 202.
             return 1;
 203.
          }
 204.
       
 205.
          if (strcmp("/s 212", cmdtext, true) == 0)
 206.
          {
 207.
             SetPlayerSkin(playerid, 212);
 208.
             return 1;
 209.
          }
 210.
       
 211.
          if (strcmp("/s 102", cmdtext, true) == 0)
 212.
          {
 213.
             SetPlayerSkin(playerid,102);
 214.
             return 1;
 215.
          }
 216.
       
 217.
          if (strcmp(cmdtext, "/boxing", true) == 0)
 218.
          {
 219.
          SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
 220.
          SendClientMessage(playerid, 0xFFFFFFAA, "You have changed your fighting style to boxing!");
 221.
          return 1;
 222.
          }
 223.
       
 224.
          if (strcmp(cmdtext, "/kungfu", true) == 0)
 225.
          {
 226.
          SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
 227.
          SendClientMessage(playerid, 0xFFFFFFAA, "You have changed your fighting style to KUNGFU!");
 228.
          return 1;
 229.
          }
 230.
         
 231.
          if (strcmp(cmdtext, "/fc1", true) == 0)
 232.
          SetPlayerPos(playerid,2096.0981,2189.2546,16.3711);
 233.
          SendClientMessage(playerid, 0xFFFFFFAA, "**You have teleported to fc 1");
 234.
         
 235.
          if (strcmp(cmdtext, "/fc2", true) == 0)
 236.
          SetPlayerPos(playerid,-552.8127,2593.2720,65.8368);
 237.
          SendClientMessage(playerid, 0xFFFFFFAA, "**You have teleported to fc 2");
 238.
         
 239.
          if(strcmp(cmdtext, "/handsup", true) == 0)
 240.
      {
 241.
          SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
 242.
          return 1;
 243.
      }
 244.
       
 245.
          if(strcmp(cmdtext, "/color126", true) == 0)
 246.
        {
 247.
          SetPlayerColor(playerid, 126);
 248.
          return 1;
 249.
        }
 250.
       
 251.
          if(strcmp(cmdtext, "/color6", true) == 0)
 252.
        {
 253.
          SetPlayerColor(playerid, 6);
 254.
          return 1;
 255.
        }
 256.
       
 257.
       
 258.
             
 259.
          if(strcmp(cmdtext, "/register", true) == 0)
 260.
          {
 261.
          new tmp[256];
 262.
          tmp = strtok(cmdtext, idx);
 263.
              if(!strlen(tmp))
 264.
              {
 265.
                  SendClientMessage(playerid, COLOR_WHITE, "USAGE: /register [password]");
 266.
              }
 267.
              else
 268.
              {
 269.
                  if (!dini_Exists(udb_encode(playername)))
 270.
                  {
 271.
                      dini_Create(udb_encode(playername));
 272.
                      dini_IntSet(udb_encode(playername), "password", udb_hash(tmp));
 273.
                      dini_IntSet(udb_encode(playername), "adminlevel", 0);
 274.
                      format(string, sizeof(string), "Account %s created! You can now login with /login %s", playername, tmp);
 275.
                      SendClientMessage(playerid, COLOR_YELLOW, string);
 276.
                      adminlevel[playerid] = 0;
 277.
                  }
 278.
                  else
 279.
                  {
 280.
                      format(string, sizeof(string), "%s is already registered.", playername,tmp);
 281.
                      SendClientMessage(playerid, COLOR_BRIGHTRED, string);
 282.
                  }
 283.
              }
 284.
              return 1;
 285.
          }
 286.
         
 287.
          if(strcmp(cmd, "/login", true) == 0)
 288.
          {
 289.
          new tmp[256], tmp2[256];
 290.
              if(logged[playerid] == -2) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are jailed.");
 291.
              else
 292.
              if(logged[playerid] == 1)
 293.
              {
 294.
                  SendClientMessage(playerid, COLOR_BRIGHTRED, "You are already logged in.");
 295.
                  return 1;
 296.
              }
 297.
              tmp = strtok(cmdtext, idx);
 298.
              if(!strlen(tmp))
 299.
              {
 300.
                  SendClientMessage(playerid, COLOR_WHITE, "USAGE: /login [password]");
 301.
              }
 302.
              else
 303.
              {
 304.
                  if (dini_Exists(udb_encode(playername)))
 305.
                  {
 306.
                      tmp2 = dini_Get(udb_encode(playername), "password");
 307.
                      if (udb_hash(tmp) != strval(tmp2))
 308.
                      {
 309.
                          SendClientMessage(playerid, COLOR_BRIGHTRED, "Invalid Password");
 310.
                      }
 311.
                      else
 312.
                      {
 313.
                          logged[playerid] = 1;
 314.
                          format(string, sizeof(string), "%s, you are now logged in .", playername);
 315.
                          SendClientMessage(playerid, COLOR_GREEN, string);
 316.
                          GivePlayerMoney(playerid, money[playerid]);
 317.
                      }
 318.
                  }
 319.
                  else
 320.
                  {
 321.
                      format(string, sizeof(string), "You are not registered Type /register [password] to create an account!", playername);
 322.
                      SendClientMessage(playerid, COLOR_BRIGHTRED, string);
 323.
                  }
 324.
              }
 325.
              return 1;
 326.
          }
 327.
         
 328.
              if (strcmp("/ramping", cmdtext, true, 10) == 0)
 329.
              {
 330.
              if(logged[playerid] == 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are not logged in.");
 331.
              else
 332.
              if(logged[playerid] == -2) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are jailed.");
 333.
              else
 334.
              if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You need to be in a vehicle to use this command.");
 335.
              else
 336.
              if(playerramp[playerid] == 0) {
 337.
              if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You need 50000$ to buy a ramp.");
 338.
              SendClientMessage(playerid, COLOR_YELLOW, "Your Ramping is enabled.");
 339.
              GivePlayerMoney(playerid, -50000);
 340.
              playerramp[playerid] = 1;
 341.
              }
 342.
              else
 343.
              if(playerramp[playerid] == 1) {
 344.
              SendClientMessage(playerid, COLOR_YELLOW, "Your Ramping is disabled.");
 345.
              playerramp[playerid] = 0;
 346.
              }
 347.
                      return 1;
 348.
              }
 349.
       
 350.
       
 351.
       
 352.
       
 353.
       
 354.
          return 0;
 355.
           
 356.
      }
 357.
       
 358.
      public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
 359.
      {
 360.
              return 1;
 361.
      }
 362.
       
 363.
      public OnPlayerExitVehicle(playerid, vehicleid)
 364.
      {
 365.
              return 1;
 366.
      }
 367.
       
 368.
      public OnPlayerStateChange(playerid, newstate, oldstate)
 369.
      {
 370.
              return 1;
 371.
      }
 372.
       
 373.
      public OnPlayerEnterCheckpoint(playerid)
 374.
      {
 375.
              return 1;
 376.
      }
 377.
       
 378.
      public OnPlayerLeaveCheckpoint(playerid)
 379.
      {
 380.
              return 1;
 381.
      }
 382.
       
 383.
      public OnPlayerEnterRaceCheckpoint(playerid)
 384.
      {
 385.
              return 1;
 386.
      }
 387.
       
 388.
      public OnPlayerLeaveRaceCheckpoint(playerid)
 389.
      {
 390.
              return 1;
 391.
      }
 392.
       
 393.
      public OnRconCommand(cmd[])
 394.
      {
 395.
              return 1;
 396.
      }
 397.
       
 398.
      public OnPlayerRequestSpawn(playerid)
 399.
      {
 400.
              return 1;
 401.
      }
 402.
       
 403.
      public OnObjectMoved(objectid)
 404.
      {
 405.
              return 1;
 406.
      }
 407.
       
 408.
      public OnPlayerObjectMoved(playerid, objectid)
 409.
      {
 410.
              return 1;
 411.
      }
 412.
       
 413.
      public OnPlayerPickUpPickup(playerid, pickupid)
 414.
      {
 415.
              return 1;
 416.
      }
 417.
       
 418.
      public OnVehicleMod(playerid, vehicleid, componentid)
 419.
      {
 420.
              return 1;
 421.
      }
 422.
       
 423.
      public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
 424.
      {
 425.
              return 1;
 426.
      }
 427.
       
 428.
      public OnVehicleRespray(playerid, vehicleid, color1, color2)
 429.
      {
 430.
              return 1;
 431.
      }
 432.
       
 433.
      public OnPlayerSelectedMenuRow(playerid, row)
 434.
      {
 435.
              return 1;
 436.
      }
 437.
       
 438.
      public OnPlayerExitedMenu(playerid)
 439.
      {
 440.
              return 1;
 441.
      }
 442.
       
 443.
      public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
 444.
      {
 445.
              return 1;
 446.
      }
 447.
       
 448.
      public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
 449.
      {
 450.
              return 1;
 451.
      }
 452.
       
 453.
      public OnRconLoginAttempt(ip[], password[], success)
 454.
      {
 455.
              return 1;
 456.
      }
 457.
       
 458.
      public OnPlayerUpdate(playerid)
 459.
      {
 460.
              return 1;
 461.
      }
 462.
       
 463.
      public OnPlayerStreamIn(playerid, forplayerid)
 464.
      {
 465.
              return 1;
 466.
      }
 467.
       
 468.
      public OnPlayerStreamOut(playerid, forplayerid)
 469.
      {
 470.
              return 1;
 471.
      }
 472.
       
 473.
      public OnVehicleStreamIn(vehicleid, forplayerid)
 474.
      {
 475.
              return 1;
 476.
      }
 477.
       
 478.
      public OnVehicleStreamOut(vehicleid, forplayerid)
 479.
      {
 480.
              return 1;
 481.
      }
 482.
       
 483.
      public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
 484.
      {
 485.
              return 1;
 486.
      }
 487.
       
 488.
      public OnPlayerClickPlayer(playerid, clickedplayerid, source)
 489.
      {
 490.
              return 1;
 491.
      }
 492.
       
 493.
      ERROR:
 494.
      C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(261) : error 017: undefined symbol "strtok"
 495.
      C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(261) : error 033: array must be indexed (variable "tmp")
 496.
      C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(262) : warning 217: loose indentation
 497.
      C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(264) : error 017: undefined symbol "COLOR_WHITE"
 498.
      C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(268) : error 017: undefined symbol "udb_encode"
 499.
      C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(270) : error 017: undefined symbol "udb_encode"
 500.
      C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(271) : error 017: undefined symbol "udb_encode"
 501.
      C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(272) : error 017: undefined symbol "udb_encode"
 502.
      C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(273) : error 017: undefined symbol "string"
 503.
      C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(273) : error 017: undefined symbol "string"
 504.
      C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(273) : error 029: invalid expression, assumed zero
 505.
      C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(273) : fatal error 107: too many error messages on one line
 506.
       
 507.
      Compilation aborted.Pawn compiler 3.2.3664                      Copyright © 1997-2006, ITB CompuPhase
 508.
       
 509.
       
 510.
      11 Errors.
Reply
#2

any help?
Reply
#3

1. You need the strtok function (https://sampwiki.blast.hk/wiki/Strtok)
2. You need to define COLOR_WHITE (Example: #define COLOR_WHITE 0xFAFAFAFF)
3. You need to create the string variable (Example: new string[ 128 ]
4. You need to get udb_encode function from the dutiles/dudb script by DracoBlue.
Reply
#4

Grim can u correct it please
Reply
#5

please one help me !!!!!!!!!!!!!!!!!!!
Reply
#6

Quote:
Originally Posted by AzTeCaS
View Post
Grim can u correct it please
He told you what to do....so pretty much he did.
Reply
#7

But i need one correct it please
Reply
#8

Buzzbomb Fix my problem please
Reply
#9

Fix it please all
Reply
#10

Correct it here;http://pastebin.com/bp6ZSP7A
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)