4 Errors
#1

I was a beginner should have good code on code issues
C:\Documents and Settings\Thien An\Desktop\WFG-RP2\WFG-RP.pwn(125515) : error 017: undefined symbol "CowStep"
C:\Documents and Settings\Thien An\Desktop\WFG-RP2\WFG-RP.pwn(125515) : error 017: undefined symbol "step"
C:\Documents and Settings\Thien An\Desktop\WFG-RP2\WFG-RP.pwn(125515) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Thien An\Desktop\WFG-RP2\WFG-RP.pwn(125515) : fatal error 107: too many error messages on one line


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


4 Errors.
below is the error code
Код:
#include <a_samp>

#define COLOR_COW_1 0xCC0000FF
#define COLOR_COW_2 0xFFAAAAFF
#define COLOR_COW_3 0xFFFF00FF
#define COLOR_COW_4 0x4444FFFF
#define COLOR_COW_5 0xCCCC00FF
#define COLOR_INTERMISSION 0x888888FF
#define COLOR_RACE_BEGINNING 0xFF1111FF
#define COLOR_ON_YOUR_MARK 0xDD0000FF
#define COLOR_GET_SET 0xDD8800FF
#define COLOR_GO_GO_GO 0x00DD00FF
#define COLOR_WINNER 0x00FF00FF
#define COLOR_WINDOW_CLOSE 0xFF0000FF

stock SetPaces()
{
	new Float:space=(1572.270019-1522.773559)/MAX_PACES;
	for(new pace;pace<MAX_PACES;pace++)YPaces[pace]=1522.773559+(space*pace);
	XPaces[0]=1101.841552;
	XPaces[1]=1098.581389;
	XPaces[2]=1095.321227;
	XPaces[3]=1092.061065;
	XPaces[4]=1088.800903;
}

stock ShowRigDialog(playerid)
{
	new list[256];
	if(RigSteroids)format(list,256,"%sSteroids - $%d\n",list,RigSteroids);
	if(RigSleepingPills)format(list,256,"%sSleeping Pills - $%d\n",list,RigSleepingPills);
	if(RigFinalStretch)format(list,256,"%sFinal Stretch - $%d\n",list,RigFinalStretch);
	if(RigPitStop)format(list,256,"%sPit Stop - $%d\n",list,RigPitStop);
	ShowPlayerDialog(playerid,USE_DIALOG_ID,DIALOG_STYLE_LIST,"Choose a Rig",list,"Select","Back");
	SetPVarInt(playerid,"DIALOG",3);
}
stock ShowRigRacerDialog(playerid)
{
	new list[256];
	format(list,256,"%s\n%s\n%s\n%s\n%s",GetRacerName(0),GetRacerName(1),GetRacerName(2),GetRacerName(3),GetRacerName(4));
	ShowPlayerDialog(playerid,USE_DIALOG_ID,DIALOG_STYLE_LIST,"Choose a Racer to Rig",list,"Rig","Back");
	SetPVarInt(playerid,"DIALOG",4);
}

stock SetTexts()
{
	LabelIsOn[0]=1;
	CowNames[0]=Create3DTextLabel(GetRacerName(0),COLOR_COW_1,1101.841552,1522.773559,10,100.0,0,1);
	LabelIsOn[1]=1;
	CowNames[1]=Create3DTextLabel(GetRacerName(1),COLOR_COW_2,1098.581389,1522.773559,10,100.0,0,1);
	LabelIsOn[2]=1;
	CowNames[2]=Create3DTextLabel(GetRacerName(2),COLOR_COW_3,1095.321227,1522.773559,10,100.0,0,1);
	LabelIsOn[3]=1;
	CowNames[3]=Create3DTextLabel(GetRacerName(3),COLOR_COW_4,1092.061065,1522.773559,10,100.0,0,1);
	LabelIsOn[4]=1;
	CowNames[4]=Create3DTextLabel(GetRacerName(4),COLOR_COW_5,1088.800903,1522.773559,10,100.0,0,1);
	RaceStart=Create3DTextLabel("Intermission",COLOR_INTERMISSION,1095.321227,1545.773559,12,100.0,0,1);
	Booths[0]=Create3DTextLabel("Ban dat cuoc\nPress F",COLOR_INTERMISSION,1107.177734,1525.321166,8.484739,100.0,0,1);
	Booths[1]=Create3DTextLabel("Ban dat cuoc\nPress F",COLOR_INTERMISSION,1083.677734,1525.320312,8.484739,100.0,0,1);
}

stock BeginCowRace()
{
	for(new step;step<5;step++)CowStep[step]=1;
	for(new object;object<5;object++)MoveObject(CowRacer[object],XPaces[object],YPaces[1],8.695835,float(random(MAX_SPEED+((CowsRigged[object][0]==1)?(RIG_SPEED):(0))-MIN_SPEED+((CowsRigged[object][1]==1)?(-RIG_SPEED):(0)))+MIN_SPEED));
}
stock ResetCowRace()
{
    for(new step;step<5;step++)
	{
		CowStep[step]=0;
		CowsRigged[step][0]=0;
		CowsRigged[step][1]=0;
		CowsRigged[step][2]=0;
		CowsRigged[step][3]=0;
	}
    for(new object;object<5;object++)MoveObject(CowRacer[object],XPaces[object],YPaces[0],8.695835,10);
    for(new label;label<5;label++)
    {
        if(LabelIsOn[label])Delete3DTextLabel(CowNames[label]);
        CowNames[label]=Create3DTextLabel(GetRacerName(label),GetRacerColor(label),XPaces[label],YPaces[0],10,100,0,1);
    }
}

stock GetRacerName(racer)
{
	new tmp[24];
	switch(racer)
	{
	    case 0:tmp="Nhat Ban";
	    case 1:tmp="Y Rat";
	    case 2:tmp="Viet Nam";
	    case 3:tmp="Anh";
	    case 4:tmp="WFG-RP";
	}
	return tmp;
}
stock GetRacerColor(racer)
{
	switch(racer)
	{
	    case 0:return COLOR_COW_1;
	    case 1:return COLOR_COW_2;
	    case 2:return COLOR_COW_3;
	    case 3:return COLOR_COW_4;
	    case 4:return COLOR_COW_5;
	}
	return 0;
}

stock GetWeaponModel(weaponid)
{
	switch(weaponid)
	{
	    case 1:
	        return 331;

		case 2..8:
		    return weaponid+331;

        case 9:
		    return 341;

		case 10..15:
			return weaponid+311;

		case 16..18:
		    return weaponid+326;

		case 22..29:
		    return weaponid+324;

		case 30,31:
		    return weaponid+325;

		case 32:
		    return 372;

		case 33..45:
		    return weaponid+324;

		case 46:
		    return 371;
	}
	return 0;
}
public OnRaceUpdate()
{
	switch(RaceStep)
	{
	    case 0: //Race is going to begin in 5 seconds
	    {
	        Update3DTextLabelText(RaceStart,COLOR_RACE_BEGINNING,"Cuoc dua duoc bat dau tro lai.");
	        RaceStep=1;
	        SetTimer("OnRaceUpdate",5000,0);
	        for(new playerid;playerid<MAX_PLAYERS;playerid++)
	        {
	            if(!IsPlayerConnected(playerid))continue;
	            if(GetPVarInt(playerid,"DIALOG"))
	            {
	                ShowPlayerDialog(playerid,-1,-1,"","","","");
	                SendClientMessage(playerid,COLOR_WINDOW_CLOSE,"Cuoc dua da~ bat dau` va` duoc dat cuoc da ket thuc!");
	                SetPVarInt(playerid,"DIALOG",0);
	            }
	        }
	    }
	    case 1:
	    {
	        Update3DTextLabelText(RaceStart,COLOR_ON_YOUR_MARK,"On Your Mark!");
	        RaceStep=2;
	        SetTimer("OnRaceUpdate",1000,0);
	    }
	    case 2:
	    {
	        Update3DTextLabelText(RaceStart,COLOR_GET_SET,"Get Set!");
	        RaceStep=3;
	        SetTimer("OnRaceUpdate",1000,0);
	    }
	    case 3:
	    {
	        Update3DTextLabelText(RaceStart,COLOR_GO_GO_GO,"Go Go Go!");
	        RaceStep=4;
	        BeginCowRace();
	    }
	    case 4:
	    {
	        new string[64];
	        format(string,64,"%s\nChienThang!",GetRacerName(RaceWinner));
			Update3DTextLabelText(CowNames[RaceWinner],COLOR_WINNER,string);
			Update3DTextLabelText(RaceStart,COLOR_WINNER,string);
			OnRaceEnd();
			RaceStep=5;
			SetTimer("OnRaceUpdate",5000,0);
	    }
	    case 5:
	    {
	        ResetCowRace();
	        Update3DTextLabelText(CowNames[RaceWinner],GetRacerColor(RaceWinner),GetRacerName(RaceWinner));
			Update3DTextLabelText(RaceStart,COLOR_INTERMISSION,"Intermission");
			RaceStep=0;
			SetTimer("OnRaceUpdate",RACE_INTERVAL,0);
	    }
	}
}

public OnObjectMoved(objectid)
{
	if(RaceStep==4)
	{
		for(new racer;racer<5;racer++)
		{
			if(objectid==CowRacer[racer])
			{
				CowStep[racer]++;
				if(CowStep[racer]==MAX_PACES)
				{
				    RaceWinner=racer;
					OnRaceUpdate();
				    return 1;
				}
				if(CowStep[racer]==MAX_PACES-5)
				{
				    if(CowsRigged[racer][3]==1)
					{
					    CowStep[racer]--;
					    CowsRigged[racer][3]=0; //So it doesn't repeat >.<
						return SetTimerEx("OnObjectMoved",RIG_PIT_STOP_TIME,0,"i",objectid);
					}
				    if(CowsRigged[racer][2]==1)CowStep[racer]=MAX_PACES-1;
				}
				MoveObject(CowRacer[racer],XPaces[racer],YPaces[CowStep[racer]],8.695835,random(MAX_SPEED+((CowsRigged[racer][0]==1)?(RIG_SPEED):(0))-MIN_SPEED+((CowsRigged[racer][1]==1)?(-RIG_SPEED):(0)))+MIN_SPEED);
				if(LabelIsOn[racer])Delete3DTextLabel(CowNames[racer]);
				CowNames[racer]=Create3DTextLabel(GetRacerName(racer),GetRacerColor(racer),XPaces[racer],YPaces[CowStep[racer]],10,100,0,1);
			}
		}
	}
	return 1;
}

public OnRaceEnd()
{
	for(new playerid;playerid<MAX_PLAYERS;playerid++)
	{
	    if(!IsPlayerConnected(playerid))continue;
	    new string[64];
	    new pvar[5];
	    format(pvar,5,"BET%d",RaceWinner);
	    SetPVarInt(playerid,pvar,GetPVarInt(playerid,pvar)*2);
	    if(GetPVarInt(playerid,pvar))
	    {
	        format(string,64,"Ban thang $%d khi dat cuoc %s!",GetPVarInt(playerid,pvar),GetRacerName(RaceWinner));
	        SendClientMessage(playerid,COLOR_WINNER,string);
	        PlayerInfo[playerid][pCash] += GetPVarInt(playerid,pvar);
		}
		for(new bet;bet<5;bet++)
		{
		    format(pvar,5,"BET%d",bet);
		    SetPVarInt(playerid,pvar,0);
		}
	}
	return 1;
}
Reply
#2

add these codes above
Код:
enum test
{
	step,
	racer
};
new CowStep[test];
That much i can understand with that codes
U haven't given line no.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)