[Help] Too much errors
#1

I'm making a gamemode but I get too much errors!
pawn Код:
#include <a_samp>

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA

new WeaponRound = 0;
new Float:Rounds[33][1] = {
{0},
{1},
{2},
{3},
{4},
{5},
{6},
{7},
{8},
{9},
{10},
{11},
{12},
{13},
{14},
{15},
{16},
{18},
{22},
{23},
{24},
{25},
{26},
{27},
{28},
{29},
{30},
{31},
{32},
{33},
{34},
{35},
{37},
{38},
};

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    SetGameModeText("[San Legends]");
    UsePlayerPedAnims();
    AddPlayerClass(0,911.9332,-1232.6490,16.9766,5.2999,-1,-1,-1,-1,-1,-1);
    SetTimer("ChangeRound",300000,false);
    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)
{
  GameTextForPlayer(playerid, "~w~SA-MP ~ ~r~San Legends", 3000, 0);
  SendClientMessage(playerid, COLOR_GREEN, "[Welcome to San Legends]");
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    GivePlayerWeapon(playerid, WeaponRound, 1000000000);
    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;
    }
    return 0;
}

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

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

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    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 OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

forward ChangeRound();
public ChangeRound()
{
    new rand = random(sizeof(Rounds));
    WeaponRound = Rounds[rand][1];
    GameTextForAll("~w~Round ~r~Change", 3000, 0);
}
And those are the errors
Код:
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(11) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(12) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(13) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(14) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(15) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(16) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(17) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(18) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(19) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(20) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(21) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(22) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(23) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(24) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(25) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(26) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(27) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(28) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(29) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(30) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(31) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(32) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(33) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(34) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(35) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(36) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(37) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(38) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(39) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(40) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(41) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(42) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(43) : warning 213: tag mismatch
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(43) : error 018: initialization data exceeds declared size
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(45) : error 010: invalid function or declaration
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(178) : error 032: array index out of bounds (variable "Rounds")
C:\Users\Evrim\Documents\SAMPServer\gamemodes\sanlegends.pwn(178) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Tag mismatch warning lines are the list and 178 is
pawn Код:
WeaponRound = Rounds[rand][1];
Please help!
Reply
#2

Rounds is not a float and you dont need an extra dimension!
Код:
new Rounds[33] = { 0, 1, 2...
Reply
#3

Oh thanks!
Reply
#4

I changed all and no errors but when I enter the game it crashes!
pawn Код:
#include <a_samp>

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA

new WeaponRound = 0;
new Rounds[34] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37,38};

main()
{
    print(" San Legends by Evrim - Loaded");
}

public OnGameModeInit()
{
    SetGameModeText("[San Legends]");
    UsePlayerPedAnims();
    AddPlayerClass(0,911.9332,-1232.6490,16.9766,5.2999,-1,-1,-1,-1,-1,-1);
    SetTimer("ChangeRound",300000,true);
    return 1;
}

public OnGameModeExit()
{
    print(" San Legends by Evrim - UnLoaded");
    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)
{
  GameTextForPlayer(playerid, "~w~SA-MP ~ ~r~San Legends", 3000, 0);
  SendClientMessage(playerid, COLOR_GREEN, "[Welcome to San Legends]");
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    GivePlayerWeapon(playerid, WeaponRound, 1000000000);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerScore(killerid, GetPlayerScore(killerid) + 5);
    GivePlayerMoney(killerid, 1000);
    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 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 OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

forward ChangeRound();
public ChangeRound()
{
    new rand = random(sizeof(Rounds));
    WeaponRound = Rounds[rand];
    GameTextForAll("~w~Round ~r~Change", 3000, 0);
    SendRconCommand("gmx");
}
Help please, thanks
Reply
#5

"~w~SA-MP ~ ~r~San Legends"
Reply
#6

OOps, I need to change it

EDIT: Changed it but now it doesnt give me weapon when I spawn - tried 3 rounds Please help

EDIT of EDIT: Fixed!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)