Help With Error Codes
#3

Quote:
Originally Posted by joshkeley
Посмотреть сообщение
I was compiling a lightly edited version of Rokzlive's Trucking Gamemode and recieved these errors:

Код:
C:\Users\keleyj\Desktop\SAMP SERVER\Server (Real)\gamemodes\public.pwn(357) : error 012: invalid function call, not a valid address
C:\Users\keleyj\Desktop\SAMP SERVER\Server (Real)\gamemodes\public.pwn(357) : error 001: expected token: ";", but found "sizeof"
C:\Users\keleyj\Desktop\SAMP SERVER\Server (Real)\gamemodes\public.pwn(357) : warning 215: expression has no effect
C:\Users\keleyj\Desktop\SAMP SERVER\Server (Real)\gamemodes\public.pwn(357) : error 001: expected token: ";", but found ")"
C:\Users\keleyj\Desktop\SAMP SERVER\Server (Real)\gamemodes\public.pwn(357) : fatal error 107: too many error messages on one line

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


4 Errors.
This is the line that is getting the error codes:
Код:
			new rand = rand(sizeof(TruckingMissionRandom));
These are the surrounding lines:
Код:
    if(!strcmp("/work", cmdtext, true))
	{
	    new pvehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
		if (pvehiclemodel == 403 || pvehiclemodel == 514 || pvehiclemodel == 515)
		{
		    new string[200];
			new rand = rand(sizeof(TruckingMissionRandom));
			CreatePlayerMission(playerid, TruckingMissionRandom[rand][UseTrailerCheck], TruckingMissionRandom[rand][MissionPay], TruckingMissionRandom[rand][loadx],TruckingMissionRandom[rand][loady], TruckingMissionRandom[rand][loadz], TruckingMissionRandom[rand][unloadx],TruckingMissionRandom[rand][unloady], TruckingMissionRandom[rand][unloadz]);
	        format(string, sizeof(string), "You are doing mission: %s", TruckingMissionRandom[rand][MissionName]);
			SendClientMessage(playerid, 0x00FF00FF, string);
		}
		else
If someone could please help me solve this problem.

Also, could someone make a topic with the most common error codes, what they mean and how to fix them? Alot of people like myself would benefit from this.

Thanks
Try

pawn Код:
if(!strcmp("/work", cmdtext, true))
    {
        new pvehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
        if (pvehiclemodel == 403 || pvehiclemodel == 514 || pvehiclemodel == 515)
        {
            new Rand = rand(sizeof(TruckingMissionRandom));
            CreatePlayerMission(playerid, TruckingMissionRandom[Rand][UseTrailerCheck], TruckingMissionRandom[Rand][MissionPay], TruckingMissionRandom[Rand][loadx],TruckingMissionRandom[Rand][loady], TruckingMissionRandom[Rand][loadz], TruckingMissionRandom[Rand][unloadx],TruckingMissionRandom[Rand][unloady], TruckingMissionRandom[Rand][unloadz]);
            new string[128];
            format(string, sizeof(string), "You are doing mission: %s", TruckingMissionRandom[rand][MissionName]);
            SendClientMessage(playerid, 0x00FF00FF, string);
        }
         else
Show your random TruckingMissionRandom creation.
Reply


Messages In This Thread
Help With Error Codes - by joshkeley - 27.09.2012, 10:45
Re: Help With Error Codes - by Roel - 27.09.2012, 10:53
Re: Help With Error Codes - by .v - 27.09.2012, 10:57
Re: Help With Error Codes - by Roel - 27.09.2012, 11:01
Re: Help With Error Codes - by joshkeley - 27.09.2012, 12:19
Re: Help With Error Codes - by Skaizo - 27.09.2012, 12:45
Re: Help With Error Codes - by joshkeley - 27.09.2012, 13:26
Re: Help With Error Codes - by joshkeley - 27.09.2012, 22:41
Re: Help With Error Codes - by mamorunl - 28.09.2012, 00:01
Re: Help With Error Codes - by joshkeley - 28.09.2012, 00:49

Forum Jump:


Users browsing this thread: 3 Guest(s)