Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

Erori la compilare! [Pawno]


Question

Guest Alien Runner
Posted

Uitati aici Scriptul:

//----Includes----
#include <a_samp>
#include <a_players>
//----End Includes----
//----Defines----
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GREEN 0x33AA33AA
//----End Defines----
public OnFilterScriptInit()
{
//----echo----
	print("\n--------------------------------------");
	print(" Truck Mod V1 by Ro_Perpentual");
	print("--------------------------------------\n");
//----echo----
//----Map here----
	CreateObject(3268, 1764.8146972656, 134.63073730469, 31.591743469238, 357, 0, 64);
	CreateObject(7238, 1769.18359375, 170.7783203125, 43.025672912598, 0, 2.999267578125, 159.99938964844);
	CreateObject(3259, 1800.1630859375, 134.51438903809, 33.044380187988, 0, 0, 340);
	CreateObject(3259, 1812.6193847656, 160.24678039551, 32.405586242676, 0, 0, 339.99938964844);
	CreateObject(3258, 1807.3881835938, 147.08117675781, 33.713649749756, 0, 0, 0);
	CreateObject(7317, 1788.5966796875, 122.3740234375, 38, 0, 0, 243.99536132813);
	CreateObject(3268, 1736.146484375, 148.6015625, 29.652599334717, 356.99523925781, 0, 63.995361328125);
	CreateObject(7102, 1818.7679443359, 128.4599609375, 35, 0, 0, 154);
	CreateObject(17020, 1703.1654052734, 146.91101074219, 33.305732727051, 0, 5, 68);
	CreateObject(10773, 1726.8638916016, 201.35404968262, 25.395853042603, 0, 350, 246);
	CreateObject(4100, 1732.4005126953, 125.94302368164, 32.599998474121, 0, 0, 296);
	CreateObject(4100, 1719.88671875, 131.5654296875, 32.532371520996, 0, 0, 295.99914550781);
	CreateObject(4100, 1765.5903320313, 113.1117401123, 34.220817565918, 0, 0, 303.99914550781);
	CreateObject(16337, 1756.7677001953, 114.47843933105, 32.799999237061, 0, 0, 68);
	CreateObject(16337, 1739.3115234375, 121.7255859375, 31.672515869141, 0, 0, 67.999877929688);
//----End Map----
//----Spawn Trailers----
	AddStaticVehicle (450, 1728.3317871094, 148.45733642578, 29.233751296997, 150, 3, 3);
    AddStaticVehicle (450, 1732.2622070313, 146.38159179688, 29.547168731689, 150, 3, 3);
    AddStaticVehicle (450, 1736.3986816406, 143.9832611084, 29.887237548828, 150, 3, 3);
    AddStaticVehicle (450, 1740.13671875, 141.59121704102, 30.205297470093, 150, 3, 3);
    AddStaticVehicle (450, 1757.6580810547, 135.89128112793, 31.224514007568, 150, 3, 3);
    AddStaticVehicle (450, 1762.0718994141, 134.2492980957, 31.4713363647, 150, 3, 3);
    AddStaticVehicle (450, 1766.1295166016, 132.1644744873, 31.72106552124, 150, 3, 3);
    AddStaticVehicle (450, 1770.2490234375, 129.78094482422, 31.981822967529, 150, 3, 3);
//----End Spawn Trailers----
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/truck", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 1729.9500732422, 111.06327819824, 32);
		SendClientMessage(playerid, COLOR_YELLOW, "Now you are trucker");
		SendClientMessage(playerid, COLOR_YELLOW, "Get a truck using  '/car [Truck Name]' , pick a trailer and go to the red marker");
		SendClientMessage(playerid, COLOR_YELLOW, "Available truck for this mission: Linerunner, Roadtrain, Trucker");
		SendClientMessage(playerid, COLOR_YELLOW, "To paint truck in Company's color, type '/paint_truck'");
		SetPlayerCheckpoint(playerid, 585.16296386719, 855.3798828125, -43.273166656494, 5);
		return 0;
	}
	if (strcmp("/paint_truck", cmdtext, true, 10) == 0)
	    {
	    ChangeVehicleColor(vehicleid, 0, 3);
		return 1;
		}

	return 2;
}

public OnPlayerEnterCheckpoint(playerid)
{
	if(IsTrailerAttachedToVehicle(403));
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
		return 0;
	}
	if(IsTrailerAttachedToVehicle(515));
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
		return 0;
	}
	if(IsTrailerAttachedToVehicle(514));
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
		return 0;
	}
	else if (IsPlayerInCheckpoint(playerid));
	{
		SendClientMessage(playerid, COLOR_YELLOW, "You need a truck with necessary trailer attached!");
		return 0;
	}
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	DisablePlayerCheckpoint(playerid);
	return 1;
}
Si uitati ce eroare imi da:
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(60) : error 017: undefined symbol "vehicleid"
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(69) : error 036: empty statement
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(75) : warning 225: unreachable code
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(75) : error 036: empty statement
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(81) : warning 225: unreachable code
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(81) : error 036: empty statement
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(87) : warning 225: unreachable code
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(87) : error 029: invalid expression, assumed zero
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(87) : warning 215: expression has no effect
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(87) : error 001: expected token: ";", but found "if"
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(87) : error 036: empty statement
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(87) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.

As vrea sa-mi spuneti si mie cum o rezolv. Multumesc!

10 answers to this question

Recommended Posts

Guest PlayON
Posted

http://pastebin.com/trmG1N2J

La if(IsTrailerAttachedToVehicle(403)):

; NU ARE CE CAUTA!

if(IsTrailerAttachedToVehicle(403))

Si eroarea cu vehicleid este pentru ca in publicul nu este vehicleid, nu este definit.

Folosesti GetPlayerVehicleId(playerid) inloc de vehicleid.Sau cum a zis mihai.

Guest Alien Runner
Posted

Ok.. am rezolvat. Acum am alta problema! I-am mai adaugat cateceva si acum cand dau compile, imi da crash. Va rog sa-mi compilati FS-ul, sau sa-mi spuneti daca am gresit ceva. Multumesc! Scriptul:

//----Includes----
#include <a_samp>
#include <a_players>
#include <a_vehicles>
//----End Includes----
//----Defines1----
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GREEN 0x33AA33AA
//----End Defines----
//----Defines2----
new vehicle = GetPlayerVehicleID(playerid);
//----Defines2----
public OnFilterScriptInit()
{
//----echo----
	print("\n--------------------------------------");
	print(" Truck Mod V1 by Ro_Perpentual");
	print("--------------------------------------\n");
//----echo----
//----Map here----
	CreateObject(3268, 1764.8146972656, 134.63073730469, 31.591743469238, 357, 0, 64);
	CreateObject(7238, 1769.18359375, 170.7783203125, 43.025672912598, 0, 2.999267578125, 159.99938964844);
	CreateObject(3259, 1800.1630859375, 134.51438903809, 33.044380187988, 0, 0, 340);
	CreateObject(3259, 1812.6193847656, 160.24678039551, 32.405586242676, 0, 0, 339.99938964844);
	CreateObject(3258, 1807.3881835938, 147.08117675781, 33.713649749756, 0, 0, 0);
	CreateObject(7317, 1788.5966796875, 122.3740234375, 38, 0, 0, 243.99536132813);
	CreateObject(3268, 1736.146484375, 148.6015625, 29.652599334717, 356.99523925781, 0, 63.995361328125);
	CreateObject(7102, 1818.7679443359, 128.4599609375, 35, 0, 0, 154);
	CreateObject(17020, 1703.1654052734, 146.91101074219, 33.305732727051, 0, 5, 68);
	CreateObject(10773, 1726.8638916016, 201.35404968262, 25.395853042603, 0, 350, 246);
	CreateObject(4100, 1732.4005126953, 125.94302368164, 32.599998474121, 0, 0, 296);
	CreateObject(4100, 1719.88671875, 131.5654296875, 32.532371520996, 0, 0, 295.99914550781);
	CreateObject(4100, 1765.5903320313, 113.1117401123, 34.220817565918, 0, 0, 303.99914550781);
	CreateObject(16337, 1756.7677001953, 114.47843933105, 32.799999237061, 0, 0, 68);
	CreateObject(16337, 1739.3115234375, 121.7255859375, 31.672515869141, 0, 0, 67.999877929688);
//----End Map----
//----Spawn Trailers----
	AddStaticVehicle (450, 1728.3317871094, 148.45733642578, 29.233751296997, 150, 3, 3);
    AddStaticVehicle (450, 1732.2622070313, 146.38159179688, 29.547168731689, 150, 3, 3);
    AddStaticVehicle (450, 1736.3986816406, 143.9832611084, 29.887237548828, 150, 3, 3);
    AddStaticVehicle (450, 1740.13671875, 141.59121704102, 30.205297470093, 150, 3, 3);
    AddStaticVehicle (450, 1757.6580810547, 135.89128112793, 31.224514007568, 150, 3, 3);
    AddStaticVehicle (450, 1762.0718994141, 134.2492980957, 31.4713363647, 150, 3, 3);
    AddStaticVehicle (450, 1766.1295166016, 132.1644744873, 31.72106552124, 150, 3, 3);
    AddStaticVehicle (450, 1770.2490234375, 129.78094482422, 31.981822967529, 150, 3, 3);
//----End Spawn Trailers----
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/truck", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 1729.9500732422, 111.06327819824, 32);
		SendClientMessage(playerid, COLOR_YELLOW, "Now you are trucker");
		SendClientMessage(playerid, COLOR_YELLOW, "Get a truck using  '/car [Truck Name]' , pick a trailer and go to the red marker.");
		SendClientMessage(playerid, COLOR_YELLOW, "Available truck for this mission: Linerunner, Roadtrain, Tanker.");
		SendClientMessage(playerid, COLOR_YELLOW, "To paint your truck to company's color, type '/paint_truck'!)
		SendClientMessage(playerid, COLOR_YELLOW, "If you want to stop the mission, type '/stop_truck'!");
		SendClientMessage(playerid, COLOR_YELLOW, "For commands type /help_truck");
		SetPlayerCheckpoint(playerid, 585.16296386719, 855.3798828125, -43.273166656494, 5);
		return 0;
	}
	if (strcmp("/paint_truck", cmdtext, true, 10) == 0)
	{
		ChangeVehicleColor(vehicle, 0, 3);
		return 0;
	}
	if (strcmp("/stop_truck", cmdtext, true, 10) == 0)
	{
	DisablePlayerCheckpoint(playerid);
	return 0;
	}
	if (strcmp("/help_truck", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, COLOR_GREEN, "----------Truck Help----------");
		SendClientMessage(playerid, COLOR_YELLOW, "'/car [Truck Name]' for spawn a truck. Trucks: Linerunner, Roadtrain, Tanker");
 		SendClientMessage(playerid, COLOR_YELLOW, "'/paint_truck' for paint truck, '/stop_truck' to stop truck mission");
		return 0;
	}
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	if(IsTrailerAttachedToVehicle(403))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
		return 0;
	}
	if(IsTrailerAttachedToVehicle(515))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
		return 0;
	}
	if(IsTrailerAttachedToVehicle(514))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
		return 0;
	}
	else
	{
		SendClientMessage(playerid, COLOR_YELLOW, "You Must get a Truck and necessary Trailer to finish the mission!");
		return 0;
	}
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	DisablePlayerCheckpoint(playerid);
	return 1;
}

Guest PlayON
Posted

Nu are ce cauta sus detot asta new vehicleid = GetPlayerVehicleID(playerid);

Vine in comanda/functie/public

http://pastebin.com/LAFC0CPr

Guest Alien Runner
Posted

Da, toate bune, comenzile /truck, /stop_truck, /paint_truck merg perfect, dar cand ajung in CheckPoint imi da crash. Ce sa-i fac? :(

Posted

Pai cred ca ai cam facut o greseala.

Asa trebuie:

if(IsTrailerAttachedToVehicle(403))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
		return 1;
	}
	if(IsTrailerAttachedToVehicle(515))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
		return 1;
	}
	if(IsTrailerAttachedToVehicle(514))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
		return 1;
	}
	else
	{
		SendClientMessage(playerid, COLOR_YELLOW, "You Must get a Truck and necessary Trailer to finish the mission!");
		return 1;
	}
	return 0;
}

Adica la sfarsitul functiei OnPlayerEnterCheckpoint pui return 0 si la celelalte trebuie sa pai return 1.

PS:Nus bun deloc la explicatii asa ca DND:))

Guest Alien Runner
Posted

Ok.. Deci pana la urma asta ar fi finalul:

//----Includes----
#include <a_samp>
#include <a_players>
#include <a_vehicles>
//----End Includes----
//----Defines1----
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GREEN 0x33AA33AA
//----End Defines----
public OnFilterScriptInit()
{
//----echo----
	print("\n--------------------------------------");
	print(" Truck Mod V1 by Ro_Perpentual");
	print("--------------------------------------\n");
//----echo----
//----Map here----
	CreateObject(3268, 1764.8146972656, 134.63073730469, 31.591743469238, 357, 0, 64);
	CreateObject(7238, 1769.18359375, 170.7783203125, 43.025672912598, 0, 2.999267578125, 159.99938964844);
	CreateObject(3259, 1800.1630859375, 134.51438903809, 33.044380187988, 0, 0, 340);
	CreateObject(3259, 1812.6193847656, 160.24678039551, 32.405586242676, 0, 0, 339.99938964844);
	CreateObject(3258, 1807.3881835938, 147.08117675781, 33.713649749756, 0, 0, 0);
	CreateObject(7317, 1788.5966796875, 122.3740234375, 38, 0, 0, 243.99536132813);
	CreateObject(3268, 1736.146484375, 148.6015625, 29.652599334717, 356.99523925781, 0, 63.995361328125);
	CreateObject(7102, 1818.7679443359, 128.4599609375, 35, 0, 0, 154);
	CreateObject(17020, 1703.1654052734, 146.91101074219, 33.305732727051, 0, 5, 68);
	CreateObject(10773, 1726.8638916016, 201.35404968262, 25.395853042603, 0, 350, 246);
	CreateObject(4100, 1732.4005126953, 125.94302368164, 32.599998474121, 0, 0, 296);
	CreateObject(4100, 1719.88671875, 131.5654296875, 32.532371520996, 0, 0, 295.99914550781);
	CreateObject(4100, 1765.5903320313, 113.1117401123, 34.220817565918, 0, 0, 303.99914550781);
	CreateObject(16337, 1756.7677001953, 114.47843933105, 32.799999237061, 0, 0, 68);
	CreateObject(16337, 1739.3115234375, 121.7255859375, 31.672515869141, 0, 0, 67.999877929688);
//----End Map----
//----Spawn Trailers----
	AddStaticVehicle (450, 1728.3317871094, 148.45733642578, 29.233751296997, 150, 3, 3);
    AddStaticVehicle (450, 1732.2622070313, 146.38159179688, 29.547168731689, 150, 3, 3);
    AddStaticVehicle (450, 1736.3986816406, 143.9832611084, 29.887237548828, 150, 3, 3);
    AddStaticVehicle (450, 1740.13671875, 141.59121704102, 30.205297470093, 150, 3, 3);
    AddStaticVehicle (450, 1757.6580810547, 135.89128112793, 31.224514007568, 150, 3, 3);
    AddStaticVehicle (450, 1762.0718994141, 134.2492980957, 31.4713363647, 150, 3, 3);
    AddStaticVehicle (450, 1766.1295166016, 132.1644744873, 31.72106552124, 150, 3, 3);
    AddStaticVehicle (450, 1770.2490234375, 129.78094482422, 31.981822967529, 150, 3, 3);
//----End Spawn Trailers----
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/truck", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 1729.9500732422, 111.06327819824, 32);
		SendClientMessage(playerid, COLOR_YELLOW, "Now you are trucker");
		SendClientMessage(playerid, COLOR_YELLOW, "Get a truck using  '/car [Truck Name]' , pick a trailer and go to the red marker.");
		SendClientMessage(playerid, COLOR_YELLOW, "Available truck for this mission: Linerunner, Roadtrain, Tanker.");
		SendClientMessage(playerid, COLOR_YELLOW, "To paint your truck to company's color, type '/paint_truck'!");
		SendClientMessage(playerid, COLOR_YELLOW, "If you want to stop the mission, type '/stop_truck'!");
		SendClientMessage(playerid, COLOR_YELLOW, "For commands type /help_truck");
		SetPlayerCheckpoint(playerid, 585.16296386719, 855.3798828125, -43.273166656494, 5);
	}
	if (strcmp("/paint_truck", cmdtext, true, 10) == 0)
	{
	    new vehicle = GetPlayerVehicleID(playerid);
		ChangeVehicleColor(vehicle, 0, 3);
	}
	if (strcmp("/stop_truck", cmdtext, true, 10) == 0)
	{
	DisablePlayerCheckpoint(playerid);
	}
	if (strcmp("/help_truck", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, COLOR_GREEN, "----------Truck Help----------");
		SendClientMessage(playerid, COLOR_YELLOW, "'/car [Truck Name]' for spawn a truck. Trucks: Linerunner, Roadtrain, Tanker");
 		SendClientMessage(playerid, COLOR_YELLOW, "'/truck' for start truck mission, '/paint_truck' for paint truck, '/stop_truck' to stop truck mission");
	}
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	if(IsTrailerAttachedToVehicle(403))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
		return 1;
	}
	if(IsTrailerAttachedToVehicle(515))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
		return 1;
	}
	if(IsTrailerAttachedToVehicle(514))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
		return 1;
	}
	else
	{
		SendClientMessage(playerid, COLOR_YELLOW, "You Must get a Truck and necessary Trailer to finish the mission!");
		return 1;
	}
	return 0;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	DisablePlayerCheckpoint(playerid);
	return 1;
}
Doar ca imi mai da o eroare:
D:\Documents and Settings\Administrator\My Documents\Downloads\SERVER Samp\samp02Xserver.win32\trucking.pwn(103) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.

Cum o rezolv? Multumesc!

Posted

A da scz ma grabisem cand am scris ca trebuia sa plec.Sterge return 1 alea si pune in loc de if alea pune else if deoarece o sa iti zica ca nu ai ala atasat decat daca nu are ulimu trailer dala si la restu o sa iti faca ce ai scris acolo adr o sa ii si zica ca nu are atasat trailerul.

in final codul e :

//----Includes----
#include <a_samp>
#include <a_players>
#include <a_vehicles>
//----End Includes----
//----Defines1----
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GREEN 0x33AA33AA
//----End Defines----
public OnFilterScriptInit()
{
//----echo----
	print("\n--------------------------------------");
	print(" Truck Mod V1 by Ro_Perpentual");
	print("--------------------------------------\n");
//----echo----
//----Map here----
	CreateObject(3268, 1764.8146972656, 134.63073730469, 31.591743469238, 357, 0, 64);
	CreateObject(7238, 1769.18359375, 170.7783203125, 43.025672912598, 0, 2.999267578125, 159.99938964844);
	CreateObject(3259, 1800.1630859375, 134.51438903809, 33.044380187988, 0, 0, 340);
	CreateObject(3259, 1812.6193847656, 160.24678039551, 32.405586242676, 0, 0, 339.99938964844);
	CreateObject(3258, 1807.3881835938, 147.08117675781, 33.713649749756, 0, 0, 0);
	CreateObject(7317, 1788.5966796875, 122.3740234375, 38, 0, 0, 243.99536132813);
	CreateObject(3268, 1736.146484375, 148.6015625, 29.652599334717, 356.99523925781, 0, 63.995361328125);
	CreateObject(7102, 1818.7679443359, 128.4599609375, 35, 0, 0, 154);
	CreateObject(17020, 1703.1654052734, 146.91101074219, 33.305732727051, 0, 5, 68);
	CreateObject(10773, 1726.8638916016, 201.35404968262, 25.395853042603, 0, 350, 246);
	CreateObject(4100, 1732.4005126953, 125.94302368164, 32.599998474121, 0, 0, 296);
	CreateObject(4100, 1719.88671875, 131.5654296875, 32.532371520996, 0, 0, 295.99914550781);
	CreateObject(4100, 1765.5903320313, 113.1117401123, 34.220817565918, 0, 0, 303.99914550781);
	CreateObject(16337, 1756.7677001953, 114.47843933105, 32.799999237061, 0, 0, 68);
	CreateObject(16337, 1739.3115234375, 121.7255859375, 31.672515869141, 0, 0, 67.999877929688);
//----End Map----
//----Spawn Trailers----
	AddStaticVehicle (450, 1728.3317871094, 148.45733642578, 29.233751296997, 150, 3, 3);
    AddStaticVehicle (450, 1732.2622070313, 146.38159179688, 29.547168731689, 150, 3, 3);
    AddStaticVehicle (450, 1736.3986816406, 143.9832611084, 29.887237548828, 150, 3, 3);
    AddStaticVehicle (450, 1740.13671875, 141.59121704102, 30.205297470093, 150, 3, 3);
    AddStaticVehicle (450, 1757.6580810547, 135.89128112793, 31.224514007568, 150, 3, 3);
    AddStaticVehicle (450, 1762.0718994141, 134.2492980957, 31.4713363647, 150, 3, 3);
    AddStaticVehicle (450, 1766.1295166016, 132.1644744873, 31.72106552124, 150, 3, 3);
    AddStaticVehicle (450, 1770.2490234375, 129.78094482422, 31.981822967529, 150, 3, 3);
//----End Spawn Trailers----
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/truck", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 1729.9500732422, 111.06327819824, 32);
		SendClientMessage(playerid, COLOR_YELLOW, "Now you are trucker");
		SendClientMessage(playerid, COLOR_YELLOW, "Get a truck using  '/car [Truck Name]' , pick a trailer and go to the red marker.");
		SendClientMessage(playerid, COLOR_YELLOW, "Available truck for this mission: Linerunner, Roadtrain, Tanker.");
		SendClientMessage(playerid, COLOR_YELLOW, "To paint your truck to company's color, type '/paint_truck'!");
		SendClientMessage(playerid, COLOR_YELLOW, "If you want to stop the mission, type '/stop_truck'!");
		SendClientMessage(playerid, COLOR_YELLOW, "For commands type /help_truck");
		SetPlayerCheckpoint(playerid, 585.16296386719, 855.3798828125, -43.273166656494, 5);
	}
	if (strcmp("/paint_truck", cmdtext, true, 10) == 0)
	{
	    new vehicle = GetPlayerVehicleID(playerid);
		ChangeVehicleColor(vehicle, 0, 3);
	}
	if (strcmp("/stop_truck", cmdtext, true, 10) == 0)
	{
	DisablePlayerCheckpoint(playerid);
	}
	if (strcmp("/help_truck", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, COLOR_GREEN, "----------Truck Help----------");
		SendClientMessage(playerid, COLOR_YELLOW, "'/car [Truck Name]' for spawn a truck. Trucks: Linerunner, Roadtrain, Tanker");
 		SendClientMessage(playerid, COLOR_YELLOW, "'/truck' for start truck mission, '/paint_truck' for paint truck, '/stop_truck' to stop truck mission");
	}
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	if(IsTrailerAttachedToVehicle(403))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
	}
	else if(IsTrailerAttachedToVehicle(515))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
	}
	else if(IsTrailerAttachedToVehicle(514))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
	}
	else
	{
		SendClientMessage(playerid, COLOR_YELLOW, "You Must get a Truck and necessary Trailer to finish the mission!");

	}
	return 0;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	DisablePlayerCheckpoint(playerid);
	return 1;
}

Guest PlayON
Posted

Fara return 1; la comenzi? Sunteti nebuni?...Va da unknown command...

Posted

ma io nu zic la  comenzi ca nu e legat de comenzi acolo.Io zic de asta:

public OnPlayerEnterCheckpoint(playerid)
{
	if(IsTrailerAttachedToVehicle(403))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
	}
	else if(IsTrailerAttachedToVehicle(515))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
	}
	else if(IsTrailerAttachedToVehicle(514))
	{
		SendClientMessage(playerid, COLOR_GREEN, "Mission Complete! +5.000$" );
		GivePlayerMoney(playerid, 5000);
	}
	else
	{
		SendClientMessage(playerid, COLOR_YELLOW, "You Must get a Truck and necessary Trailer to finish the mission!");

	}
	return 0;
}

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.