Need Help Fixing Problems
#1

Код:
#include <a_samp>

#define MAFIA 0
#define POLICE 1
#define VIP 2
#define MAFIA_COLOUR 0x00820FAA
#define POLICE_COLOUR 0x003DF5AA
#define VIP_COLOUR 0x6600FF
#define COLOR_RED 0xFF0000AA
enum TeamCars
{
MAFIA,
Police,
VIP,
}
new gTeam[MAX_PLAYERS];
new Cars[TeamCars];
new hqgate0;
new hqgate1;


main()
{
	print("\n----------------------------------");
	print(" Las Venturas CnR Rags To Riches");
	print("----------------------------------\n");
}


public OnGameModeInit()
{
    AddPlayerClass(105,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0); //Grove Street Gang Member (0)
    AddPlayerClass(280,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Police Officer (1)
    AddPlayerClass(147,2502.5593,2778.7959,10.8203,167.7076,0,0,0,0,0,0); // VIP male spawn
	Cars[MAFIA] = CreateVehicle(492,2484.3054,-1655.0886,13.1036,90.8565,44,16,900); //Greenwood
    Cars[POLICE] = CreateVehicle(596,1536.0603,-1676.5302,13.1054,0.6847,-1,-1,900);
    Cars[VIP] = CreateVehicle(596,1536.0603,-1676.5302,13.1054,0.6847,-1,-1,900);
    hqgate0 = CreateObject(971, 2492.9870605469, 2772.6166992188, 9.9616632461548, 90, 0, 0);
    hqgate1 = CreateObject(971, 2501.8193359375, 2772.3293457031, 9.9023017883301, 90, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid);
    return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

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

public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColour(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(cmdtext,"/opengate", true) == 0)
    {
         if (gTeam[playerid] == VIP)
         {
             if(IsPlayerInRangeOfPoint(playerid, 15.0, 2501.8193359375, 2772.3293457031, 9.9023017883301))
             {
                MoveObject(hqgate0, 2492.9870605469, 2772.6166992188, 16.9616632461548, 90);
                MoveObject(hqgate1, 2501.8193359375, 2772.3293457031, 16.9023017883301, 90);
			 }
        }
    }
    if(strcmp(cmdtext,"/closegate", true) == 0)
    {
        if (gTeam[playerid] == VIP)
        {
            if(IsPlayerInRangeOfPoint(playerid, 15.0, 2501.8193359375, 2772.3293457031, 9.9023017883301))
            {
                MoveObject(hqgate0, 2492.9870605469, 2772.6166992188, 9.9616632461548, 90);
                MoveObject(hqgate1, 2501.8193359375, 2772.3293457031, 9.9023017883301, 90);
            }
        }
        return 1;
    }
    return 0;
 }

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

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

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == Cars[MAFIA] )
        {
            if(gTeam[playerid] != 0)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
                return 1;
            }
        }
        if(CarCheck == Cars[POLICE] )
        {
            if(gTeam[playerid] != 1)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
                return 1;
            }
        }
        if(CarCheck == Cars[VIP] )
        {
            if(gTeam[playerid] != 2)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
                return 1;
            }
        }
    }
    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;
}
SetPlayerTeamFromClass(playerid, classid)
{
    if(classid == 0)
    {
        gTeam[playerid] = MAFIA;
    }
    if(classid == 1)
    {
        gTeam[playerid] = POLICE;
    }
        if(classid == 1)
    {
    if(classid == 2)
    {
        gTeam[playerid] = VIP;
    }
        if(classid == 2)
    {
}
SetPlayerToTeamColour(playerid)
{
    if(gTeam[playerid] == MAFIA)
    {
        SetPlayerColor(playerid,MAFIA_COLOUR); //Green
    }
    if(gTeam[playerid] == POLICE)
    {
        SetPlayerColor(playerid,POLICE_COLOUR); // Blue
    }
        if(gTeam[playerid] == VIP)
    {
        SetPlayerColor(playerid,VIP_COLOUR); // Purple
    }
    return 1;
}
Код:
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(12) : error 001: expected token: "-identifier-", but found "-integer value-"
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(35) : warning 213: tag mismatch
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(36) : warning 213: tag mismatch
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(36) : error 032: array index out of bounds (variable "Cars")
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(37) : warning 213: tag mismatch
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(37) : error 032: array index out of bounds (variable "Cars")
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(66) : error 017: undefined symbol "SetPlayerToTeamColour"
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(133) : warning 213: tag mismatch
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(142) : warning 213: tag mismatch
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(142) : error 032: array index out of bounds (variable "Cars")
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(151) : warning 213: tag mismatch
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(151) : error 032: array index out of bounds (variable "Cars")
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(293) : warning 217: loose indentation
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(299) : warning 217: loose indentation
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(302) : warning 217: loose indentation
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(302) : error 017: undefined symbol "SetPlayerToTeamColour"
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(312) : warning 217: loose indentation
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(316) : warning 217: loose indentation
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(318) : error 030: compound statement not closed at the end of file (started at line 295)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Thank you for Assisting me
Reply
#2

Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
pawn Код:
#include <a_samp>

#define MAFIA 0
#define POLICE 1
#define VIP 2
#define MAFIA_COLOUR 0x00820FAA
#define POLICE_COLOUR 0x003DF5AA
#define VIP_COLOUR 0x6600FF
#define COLOR_RED 0xFF0000AA
new gTeam[MAX_PLAYERS];
new Cars[MAX_VEHICLES];
new hqgate0;
new hqgate1;


main()
{
    print("\n----------------------------------");
    print(" Las Venturas CnR Rags To Riches");
    print("----------------------------------\n");
}


public OnGameModeInit()
{
    AddPlayerClass(105,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0); //Grove Street Gang Member (0)
    AddPlayerClass(280,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Police Officer (1)
    AddPlayerClass(147,2502.5593,2778.7959,10.8203,167.7076,0,0,0,0,0,0); // VIP male spawn
    Cars[MAFIA] = CreateVehicle(492,2484.3054,-1655.0886,13.1036,90.8565,44,16,900); //Greenwood
    Cars[POLICE] = CreateVehicle(596,1536.0603,-1676.5302,13.1054,0.6847,-1,-1,900);
    Cars[VIP] = CreateVehicle(596,1536.0603,-1676.5302,13.1054,0.6847,-1,-1,900);
    hqgate0 = CreateObject(971, 2492.9870605469, 2772.6166992188, 9.9616632461548, 90, 0, 0);
    hqgate1 = CreateObject(971, 2501.8193359375, 2772.3293457031, 9.9023017883301, 90, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid);
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

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

public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColour(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(cmdtext,"/opengate", true) == 0)
    {
         if (gTeam[playerid] == VIP)
         {
             if(IsPlayerInRangeOfPoint(playerid, 15.0, 2501.8193359375, 2772.3293457031, 9.9023017883301))
             {
                MoveObject(hqgate0, 2492.9870605469, 2772.6166992188, 16.9616632461548, 90);
                MoveObject(hqgate1, 2501.8193359375, 2772.3293457031, 16.9023017883301, 90);
             }
        }
    }
    if(strcmp(cmdtext,"/closegate", true) == 0)
    {
        if (gTeam[playerid] == VIP)
        {
            if(IsPlayerInRangeOfPoint(playerid, 15.0, 2501.8193359375, 2772.3293457031, 9.9023017883301))
            {
                MoveObject(hqgate0, 2492.9870605469, 2772.6166992188, 9.9616632461548, 90);
                MoveObject(hqgate1, 2501.8193359375, 2772.3293457031, 9.9023017883301, 90);
            }
        }
        return 1;
    }
    return 0;
 }

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

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

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == Cars[0] )
        {
            if(gTeam[playerid] != 0)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
                return 1;
            }
        }
        if(CarCheck == Cars[1] )
        {
            if(gTeam[playerid] != 1)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
                return 1;
            }
        }
        if(CarCheck == Cars[2] )
        {
            if(gTeam[playerid] != 2)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
                return 1;
            }
        }
    }
    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;
}
SetPlayerTeamFromClass(playerid, classid)
{
    if(classid == 0)
    {
        gTeam[playerid] = MAFIA;
    }
    if(classid == 1)
    {
        gTeam[playerid] = POLICE;
    }
    if(classid == 2)
    {
        gTeam[playerid] = VIP;
    }
}
SetPlayerToTeamColour(playerid)
{
    if(gTeam[playerid] == MAFIA)
    {
        SetPlayerColor(playerid,MAFIA_COLOUR); //Green
    }
    if(gTeam[playerid] == POLICE)
    {
        SetPlayerColor(playerid,POLICE_COLOUR); // Blue
    }
    if(gTeam[playerid] == VIP)
    {
        SetPlayerColor(playerid,VIP_COLOUR); // Purple
    }
    return 1;
}

Hope this helps,
Camacorn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)