Jump to content
  • 0

Problema Job Checkpoint


Pinki95

Question

Gamemode:

[pawn]#include <a_samp>

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define COLOR_ORANGE 0xFFA500FF

#define COLOR_LIMEGREEN 0x32CD32FF

#define COLOR_ROYALBLUE 0x4169E1FF

#define COLOR_SALMON 0xFA8072FF

#define COLOR_GREY 0xAFAFAFAA

#define COLOR_GREEN 0x33AA33AA

#define COLOR_RED 0xAA3333AA

#define COLOR_YELLOW 0xFFFF00AA

#define COLOR_WHITE 0xFFFFFFAA

#define COLOR_BLUE 0x0000BBAA

#define COLOR_LIGHTBLUE 0x33CCFFAA

#define COLOR_RED 0xAA3333AA

enum MisLocationsEnum

{

ID,

LoadName[128],

Float:LoadX,

Float:LoadY,

Float:LoadZ,

Float:UnloadX,

Float:UnloadY,

Float:UnloadZ,

Pay

}

new MisLocations[][MisLocationsEnum] =

{

{0, "Beer from Red County Brewery to Bone County Diner",-24.4073,-281.8898,5.9985,-305.4319,1315.6797,54.6189, 5980},

{1, "Fuel from LV Oil Refinery to LV Dirtring",266.8981,1416.5417,10.2001,1097.5164,1741.7422,10.5474, 5700},

{2, "Vehicle Parts from SF Airport ATC to Wang Cars",-1268.8223,13.6925,14.8682,-1986.3477,253.9728,35.8985, 3000},

{3, "Fuel from SF Oil Refinery to RS Haul",-1016.3634,-688.2434,32.7284,-55.3397,-1138.2479,0.8052, 18770}

};

#define TEAM_TRUCKER 1

new iMissionText[512][MAX_PLAYERS], Float:unx[MAX_PLAYERS], Float:uny[MAX_PLAYERS], Float:unz[MAX_PLAYERS], iPay[MAX_PLAYERS], MissionStatus[MAX_PLAYERS];

main(){}

public OnGameModeInit()

{

AddPlayerClass(72, -2105.3228, -124.2982, 37.2531, 0.0, 0,0,0,0,0,0);//Trucker - SF

return 1;

}

public OnPlayerRequestClass(playerid, classid)

{

switch (classid)

{

case 0:

{

GameTextForPlayer(playerid, "Trucker", 3000, 4);

SetPlayerTeam(playerid, TEAM_TRUCKER);

}

}

return 1;

}

public OnPlayerSpawn(playerid)

{

if(GetPlayerTeam(playerid) == TEAM_TRUCKER)

{

SetPlayerColor(playerid, COLOR_GREEN);

}

return 1;

}

public OnPlayerCommandText(playerid, cmdtext[])

{

dcmd(work, 4, cmdtext);

dcmd(stopwork, 8, cmdtext);

return 0;

}

dcmd_work(playerid, params[])

{

#pragma unused params

if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return T_NewJob(playerid);

return 1;

}

dcmd_stopwork(playerid, params[])

{

    #pragma unused params

if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return StopWork(playerid);

return 1;

}

stock T_NewJob(playerid)

{

    new vID = GetPlayerVehicleID(playerid);

if(GetVehicleModel(vID)== 403 || GetVehicleModel(vID)== 515 || GetVehicleModel(vID) == 514)

{

    if(IsTrailerAttachedToVehicle(vID))

    {

    MissionStatus[playerid] = 1;

    new MisRand = random(sizeof(MisLocations));

new LoadText[128], Float:x, Float:y, Float:z;

x = MisLocations[MisRand][LoadX];

y = MisLocations[MisRand][LoadY];

z = MisLocations[MisRand][LoadZ];

unx[playerid] = MisLocations[MisRand][unloadX];

uny[playerid] = MisLocations[MisRand][unloadY];

unz[playerid] = MisLocations[MisRand][unloadZ];

iPay[playerid] = MisLocations[MisRand][Pay];

SetPlayerCheckpoint(playerid, x, y, z, 7);

format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);

SendClientMessage(playerid, COLOR_GREEN, "Mission:");

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

SendClientMessage(playerid, COLOR_GREEN, "");

SendClientMessage(playerid, 0xFFFFFFFF, LoadText);

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

}

else

{

SendClientMessage(playerid, COLOR_RED, "You need a trailer!");

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You must be in a Truck to perform this!");

}

return 1;

}

stock StopWork(playerid)

{

DisablePlayerCheckpoint(playerid);

SendClientMessage(playerid, COLOR_RED, "You chose to cancel the mission and got fined $100");

GivePlayerMoney(playerid, -100);

MissionStatus[playerid] = 0;

return 1;

}

public OnPlayerEnterCheckpoint(playerid)

{

CheckpointEntered(playerid);

return 1;

}

stock CheckpointEntered(playerid)

{

new gString[128];

new vID = GetPlayerVehicleID(playerid);

if(!IsTrailerAttachedToVehicle(vID)) return SendClientMessage(playerid, COLOR_RED, "You need a trailer to unload!");

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_GREEN, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+2);

MissionStatus[playerid] = 0;

}

return 1;

}

stock pName(PN)

{

new PX[MAX_PLAYER_NAME];

GetPlayerName(PN, PX, sizeof(PX));

return PX;

}[/pawn]

cum sa fac sa adaug asta in Gamemode?:

[pawn]#include <a_samp>

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define COLOR_ORANGE 0xFFA500FF

#define COLOR_LIMEGREEN 0x32CD32FF

#define COLOR_ROYALBLUE 0x4169E1FF

#define COLOR_SALMON 0xFA8072FF

#define COLOR_GREY 0xAFAFAFAA

#define COLOR_GREEN 0x33AA33AA

#define COLOR_RED 0xAA3333AA

#define COLOR_YELLOW 0xFFFF00AA

#define COLOR_WHITE 0xFFFFFFAA

#define COLOR_BLUE 0x0000BBAA

#define COLOR_LIGHTBLUE 0x33CCFFAA

#define COLOR_RED 0xAA3333AA

enum MisLocationsEnum

{

ID,

LoadName[128],

Float:LoadX,

Float:LoadY,

Float:LoadZ,

Float:UnloadX,

Float:UnloadY,

Float:UnloadZ,

Pay

}

new MisLocations[][MisLocationsEnum] =

{

{0, "Beer from Red County Brewery to Bone County Diner",-24.4073,-281.8898,5.9985,-305.4319,1315.6797,54.6189, 5980},

{1, "Fuel from LV Oil Refinery to LV Dirtring",266.8981,1416.5417,10.2001,1097.5164,1741.7422,10.5474, 5700},

{2, "Vehicle Parts from SF Airport ATC to Wang Cars",-1268.8223,13.6925,14.8682,-1986.3477,253.9728,35.8985, 3000},

{3, "Fuel from SF Oil Refinery to RS Haul",-1016.3634,-688.2434,32.7284,-55.3397,-1138.2479,0.8052, 18770}

};

#define TEAM_PILOT 1

new iMissionText[512][MAX_PLAYERS], Float:unx[MAX_PLAYERS], Float:uny[MAX_PLAYERS], Float:unz[MAX_PLAYERS], iPay[MAX_PLAYERS], MissionStatus[MAX_PLAYERS];

main(){}

public OnGameModeInit()

{

AddPlayerClass(98, -2105.3228, -124.2982, 37.2531, 0.0, 0,0,0,0,0,0);//Trucker - SF

return 1;

}

public OnPlayerRequestClass(playerid, classid)

{

switch (classid)

{

case 0:

{

GameTextForPlayer(playerid, "Pilot", 3000, 4);

SetPlayerTeam(playerid, TEAM_PILOT);

}

}

return 1;

}

public OnPlayerSpawn(playerid)

{

if(GetPlayerTeam(playerid) == TEAM_PILOT)

{

SetPlayerColor(playerid, COLOR_RED);

}

return 1;

}

public OnPlayerCommandText(playerid, cmdtext[])

{

dcmd(work, 4, cmdtext);

dcmd(stopwork, 8, cmdtext);

return 0;

}

dcmd_work(playerid, params[])

{

#pragma unused params

if(GetPlayerTeam(playerid) == TEAM_PILOT) return T_NewJob(playerid);

return 1;

}

dcmd_stopwork(playerid, params[])

{

    #pragma unused params

if(GetPlayerTeam(playerid) == TEAM_PILOT) return StopWork(playerid);

return 1;

}

stock T_NewJob(playerid)

{

    new vID = GetPlayerVehicleID(playerid);

if(GetVehicleModel(vID)== 511 || GetVehicleModel(vID)== 519 || GetVehicleModel(vID) == 553)

{

    MissionStatus[playerid] = 1;

    new MisRand = random(sizeof(MisLocations));

new LoadText[128], Float:x, Float:y, Float:z;

x = MisLocations[MisRand][LoadX];

y = MisLocations[MisRand][LoadY];

z = MisLocations[MisRand][LoadZ];

unx[playerid] = MisLocations[MisRand][unloadX];

uny[playerid] = MisLocations[MisRand][unloadY];

unz[playerid] = MisLocations[MisRand][unloadZ];

iPay[playerid] = MisLocations[MisRand][Pay];

SetPlayerCheckpoint(playerid, x, y, z, 7);

format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);

SendClientMessage(playerid, COLOR_GREEN, "Mission:");

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

SendClientMessage(playerid, COLOR_GREEN, "");

SendClientMessage(playerid, 0xFFFFFFFF, LoadText);

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You must be in a Plane to perform this!");

}

return 1;

}

stock StopWork(playerid)

{

DisablePlayerCheckpoint(playerid);

SendClientMessage(playerid, COLOR_RED, "You chose to cancel the mission and got fined $100");

GivePlayerMoney(playerid, -100);

MissionStatus[playerid] = 0;

return 1;

}

public OnPlayerEnterCheckpoint(playerid)

{

CheckpointEntered(playerid);

return 1;

}

stock CheckpointEntered(playerid)

{

new gString[128];

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_GREEN, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+2);

MissionStatus[playerid] = 0;

}

return 1;

}

stock pName(PN)

{

new PX[MAX_PLAYER_NAME];

GetPlayerName(PN, PX, sizeof(PX));

return PX;

}[/pawn]

560x95_F01616_1625F2_030303_000000.png
Link to comment
Share on other sites

14 answers to this question

Recommended Posts

Am incercat sa fac asta singur dar imi da asta:

C:\Documents and Settings\SkyNet\Desktop\Untitled.pwn(41) : warning 201: redefinition of constant/macro (symbol "teamid")

C:\Documents and Settings\SkyNet\Desktop\Untitled.pwn(174) : error 002: only a single statement (or expression) can follow each "case"

C:\Documents and Settings\SkyNet\Desktop\Untitled.pwn(174) : warning 215: expression has no effect

C:\Documents and Settings\SkyNet\Desktop\Untitled.pwn(175) : warning 209: function "T_NewJob" should return a value

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Error.

[pawn]#include <a_samp>

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define COLOR_ORANGE 0xFFA500FF

#define COLOR_LIMEGREEN 0x32CD32FF

#define COLOR_ROYALBLUE 0x4169E1FF

#define COLOR_SALMON 0xFA8072FF

#define COLOR_GREY 0xAFAFAFAA

#define COLOR_GREEN 0x33AA33AA

#define COLOR_RED 0xAA3333AA

#define COLOR_YELLOW 0xFFFF00AA

#define COLOR_WHITE 0xFFFFFFAA

#define COLOR_BLUE 0x0000BBAA

#define COLOR_LIGHTBLUE 0x33CCFFAA

#define COLOR_RED 0xAA3333AA

enum MisLocationsEnum

{

ID,

LoadName[128],

Float:LoadX,

Float:LoadY,

Float:LoadZ,

Float:UnloadX,

Float:UnloadY,

Float:UnloadZ,

Pay

}

new MisLocations[][MisLocationsEnum] =

{

{0, "Beer from Red County Brewery to Bone County Diner",-24.4073,-281.8898,5.9985,-305.4319,1315.6797,54.6189, 5980},

{1, "Fuel from LV Oil Refinery to LV Dirtring",266.8981,1416.5417,10.2001,1097.5164,1741.7422,10.5474, 5700},

{2, "Vehicle Parts from SF Airport ATC to Wang Cars",-1268.8223,13.6925,14.8682,-1986.3477,253.9728,35.8985, 3000},

{3, "Fuel from SF Oil Refinery to RS Haul",-1016.3634,-688.2434,32.7284,-55.3397,-1138.2479,0.8052, 18770}

};

#define TEAM_TRUCKER 1

#define TEAM_PILOT 2

#define teamid TEAM_TRUCKER

#define teamid TEAM_PILOT

new iMissionText[512][MAX_PLAYERS], Float:unx[MAX_PLAYERS], Float:uny[MAX_PLAYERS], Float:unz[MAX_PLAYERS], iPay[MAX_PLAYERS], MissionStatus[MAX_PLAYERS];

main(){}

public OnGameModeInit()

{

AddPlayerClass(72, -2105.3228, -124.2982, 37.2531, 0.0, 0,0,0,0,0,0);//Trucker - SF

AddPlayerClass(98, -2105.3228, -124.2982, 37.2531, 0.0, 0,0,0,0,0,0);//Trucker - SF

return 1;

}

public OnPlayerRequestClass(playerid, classid)

{

switch (classid)

{

case 0:

{

GameTextForPlayer(playerid, "Trucker", 3000, 4);

SetPlayerTeam(playerid, TEAM_TRUCKER);

}

case 1:

{

    GameTextForPlayer(playerid, "Pilot", 3000, 3);

    SetPlayerTeam(playerid, TEAM_PILOT);

}

}

return 1;

}

public OnPlayerSpawn(playerid)

{

if(GetPlayerTeam(playerid) == TEAM_TRUCKER)

{

SetPlayerColor(playerid, COLOR_GREEN);

}

if(GetPlayerTeam(playerid) == TEAM_PILOT)

{

    SetPlayerColor(playerid, COLOR_RED);

}

return 1;

}

public OnPlayerCommandText(playerid, cmdtext[])

{

dcmd(work, 4, cmdtext);

dcmd(stopwork, 8, cmdtext);

return 0;

}

dcmd_work(playerid, params[])

{

#pragma unused params

if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return T_NewJob(playerid);

if(GetPlayerTeam(playerid) == TEAM_PILOT) return T_NewJob(playerid);

return 1;

}

dcmd_stopwork(playerid, params[])

{

    #pragma unused params

if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return StopWork(playerid);

if(GetPlayerTeam(playerid) == TEAM_PILOT) return StopWork(playerid);

return 1;

}

stock T_NewJob(playerid)

{

    new vID = GetPlayerVehicleID(playerid);

    switch (teamid)

    {

        case 0:

        {

if(GetVehicleModel(vID)== 403 || GetVehicleModel(vID)== 515 || GetVehicleModel(vID) == 514)

{

    if(IsTrailerAttachedToVehicle(vID))

    {

    MissionStatus[playerid] = 1;

    new MisRand = random(sizeof(MisLocations));

new LoadText[128], Float:x, Float:y, Float:z;

x = MisLocations[MisRand][LoadX];

y = MisLocations[MisRand][LoadY];

z = MisLocations[MisRand][LoadZ];

unx[playerid] = MisLocations[MisRand][unloadX];

uny[playerid] = MisLocations[MisRand][unloadY];

unz[playerid] = MisLocations[MisRand][unloadZ];

iPay[playerid] = MisLocations[MisRand][Pay];

SetPlayerCheckpoint(playerid, x, y, z, 7);

format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);

SendClientMessage(playerid, COLOR_GREEN, "Mission:");

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

SendClientMessage(playerid, COLOR_GREEN, "");

SendClientMessage(playerid, 0xFFFFFFFF, LoadText);

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

}

else

{

SendClientMessage(playerid, COLOR_RED, "You need a trailer!");

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You must be in a Truck to perform this!");

}

}

case 1:

{

if(GetVehicleModel(vID)== 511 || GetVehicleModel(vID)== 519 || GetVehicleModel(vID) == 553)

{

MissionStatus[playerid] = 1;

new MisRand = random(sizeof(MisLocations));

new LoadText[128], Float:x, Float:y, Float:z;

x = MisLocations[MisRand][LoadX];

y = MisLocations[MisRand][LoadY];

z = MisLocations[MisRand][LoadZ];

unx[playerid] = MisLocations[MisRand][unloadX];

uny[playerid] = MisLocations[MisRand][unloadY];

unz[playerid] = MisLocations[MisRand][unloadZ];

iPay[playerid] = MisLocations[MisRand][Pay];

SetPlayerCheckpoint(playerid, x, y, z, 7);

format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);

SendClientMessage(playerid, COLOR_GREEN, "Mission:");

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

SendClientMessage(playerid, COLOR_GREEN, "");

SendClientMessage(playerid, 0xFFFFFFFF, LoadText);

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You must be in a Plane to perform this!");

}

}

return 1;

}

stock StopWork(playerid)

{

DisablePlayerCheckpoint(playerid);

SendClientMessage(playerid, COLOR_RED, "You chose to cancel the mission and got fined $100");

GivePlayerMoney(playerid, -100);

MissionStatus[playerid] = 0;

return 1;

}

public OnPlayerEnterCheckpoint(playerid)

{

CheckpointEntered(playerid);

return 1;

}

stock CheckpointEntered(playerid)

{

new gString[128];

new vID = GetPlayerVehicleID(playerid);

if(!IsTrailerAttachedToVehicle(vID)) return SendClientMessage(playerid, COLOR_RED, "You need a trailer to unload!");

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_GREEN, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+2);

MissionStatus[playerid] = 0;

}

return 1;

}

stock pName(PN)

{

new PX[MAX_PLAYER_NAME];

GetPlayerName(PN, PX, sizeof(PX));

return PX;

}[/pawn]

560x95_F01616_1625F2_030303_000000.png
Link to comment
Share on other sites

Errorile le-am rezolvat dar cand vreau sa intru in primul checkpoint cu avionul zice ca am nevoie de trailer pt a incarca problema este din linia asta

[pawn]if (!IsTrailerAttachedToVehicle(vID)) return SendClientMessage(playerid, COLOR_RED, "You need a trailer to unload!");[/pawn]

daca sterg linia Tiristii pot sa intre in checkpoint fara remorca

Cum sa fac sa nu sterg Linia?

[pawn]#include <a_samp>

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define COLOR_ORANGE 0xFFA500FF

#define COLOR_LIMEGREEN 0x32CD32FF

#define COLOR_ROYALBLUE 0x4169E1FF

#define COLOR_SALMON 0xFA8072FF

#define COLOR_GREY 0xAFAFAFAA

#define COLOR_GREEN 0x33AA33AA

#define COLOR_RED 0xAA3333AA

#define COLOR_YELLOW 0xFFFF00AA

#define COLOR_WHITE 0xFFFFFFAA

#define COLOR_BLUE 0x0000BBAA

#define COLOR_LIGHTBLUE 0x33CCFFAA

#define COLOR_RED 0xAA3333AA

enum MisLocationsEnum

{

ID,

LoadName[128],

Float:LoadX,

Float:LoadY,

Float:LoadZ,

Float:UnloadX,

Float:UnloadY,

Float:UnloadZ,

Pay

}

new MisLocations[][MisLocationsEnum] =

{

{0, "Beer from Red County Brewery to Bone County Diner",-24.4073,-281.8898,5.9985,-305.4319,1315.6797,54.6189, 5980},

{1, "Fuel from LV Oil Refinery to LV Dirtring",266.8981,1416.5417,10.2001,1097.5164,1741.7422,10.5474, 5700},

{2, "Vehicle Parts from SF Airport ATC to Wang Cars",-1268.8223,13.6925,14.8682,-1986.3477,253.9728,35.8985, 3000},

{3, "Fuel from SF Oil Refinery to RS Haul",-1016.3634,-688.2434,32.7284,-55.3397,-1138.2479,0.8052, 18770}

};

#define TEAM_TRUCKER 1

#define TEAM_PILOT 2

new iMissionText[512][MAX_PLAYERS], Float:unx[MAX_PLAYERS], Float:uny[MAX_PLAYERS], Float:unz[MAX_PLAYERS], iPay[MAX_PLAYERS], MissionStatus[MAX_PLAYERS];

main(){}

public OnGameModeInit()

{

AddPlayerClass(72, -2105.3228, -124.2982, 37.2531, 0.0, 0,0,0,0,0,0);//Trucker - SF

AddPlayerClass(98, -2105.3228, -124.2982, 37.2531, 0.0, 0,0,0,0,0,0);//Trucker - SF

AddStaticVehicle(515,-1429.2000,-299.8479,15.0205,227.3141,1,1); // tir

AddStaticVehicle(435,-1444.9415,-287.5022,14.6383,231.9411,1,1); // remorca

AddStaticVehicle(511,-2125.8181,-128.2662,35.3203,175.6829,1,1); // Plane

AddStaticVehicle(511,-2070.8518,-77.0231,35.3203,271.2773,1,1); //Plane

return 1;

}

public OnPlayerRequestClass(playerid, classid)

{

switch (classid)

{

case 0:

{

GameTextForPlayer(playerid, "Trucker", 3000, 4);

SetPlayerTeam(playerid, TEAM_TRUCKER);

}

case 1:

{

    GameTextForPlayer(playerid, "Pilot", 3000, 3);

    SetPlayerTeam(playerid, TEAM_PILOT);

}

}

return 1;

}

public OnPlayerSpawn(playerid)

{

if(GetPlayerTeam(playerid) == TEAM_TRUCKER)

{

SetPlayerColor(playerid, COLOR_GREEN);

}

if(GetPlayerTeam(playerid) == TEAM_PILOT)

{

    SetPlayerColor(playerid, COLOR_RED);

}

return 1;

}

public OnPlayerCommandText(playerid, cmdtext[])

{

if (strcmp("/kill", cmdtext, true, 5) == 0)

{

SetPlayerHealth(playerid, 0);

return 1;

}

if (strcmp("/reclass", cmdtext, true, 8) == 0)

{

        ForceClassSelection(playerid);

return 1;

}

dcmd(work, 4, cmdtext);

dcmd(stopwork, 8, cmdtext);

return 0;

}

dcmd_work(playerid, params[])

{

#pragma unused params

if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return T_NewJob(playerid);

if(GetPlayerTeam(playerid) == TEAM_PILOT) return T_NewJob2(playerid);

return 1;

}

dcmd_stopwork(playerid, params[])

{

    #pragma unused params

if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return StopWork(playerid);

if(GetPlayerTeam(playerid) == TEAM_PILOT) return StopWork(playerid);

return 1;

}

stock T_NewJob(playerid)

{

    new vID = GetPlayerVehicleID(playerid);

if(GetVehicleModel(vID)== 403 || GetVehicleModel(vID)== 515 || GetVehicleModel(vID)== 593 || GetVehicleModel(vID) == 514)

{

    if(IsTrailerAttachedToVehicle(vID))

    {

    MissionStatus[playerid] = 1;

    new MisRand = random(sizeof(MisLocations));

new LoadText[128], Float:x, Float:y, Float:z;

x = MisLocations[MisRand][LoadX];

y = MisLocations[MisRand][LoadY];

z = MisLocations[MisRand][LoadZ];

unx[playerid] = MisLocations[MisRand][unloadX];

uny[playerid] = MisLocations[MisRand][unloadY];

unz[playerid] = MisLocations[MisRand][unloadZ];

iPay[playerid] = MisLocations[MisRand][Pay];

SetPlayerCheckpoint(playerid, x, y, z, 7);

format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);

SendClientMessage(playerid, COLOR_GREEN, "Mission:");

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

SendClientMessage(playerid, COLOR_GREEN, "");

SendClientMessage(playerid, 0xFFFFFFFF, LoadText);

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

}

else

{

SendClientMessage(playerid, COLOR_RED, "You need a trailer!");

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You must be in a Truck to perform this!");

}

return 1;

}

stock T_NewJob2(playerid)

{

    new vID = GetPlayerVehicleID(playerid);

if(GetVehicleModel(vID)== 511 || GetVehicleModel(vID)== 519 || GetVehicleModel(vID) == 553)

{

    MissionStatus[playerid] = 1;

    new MisRand = random(sizeof(MisLocations));

new LoadText[128], Float:x, Float:y, Float:z;

x = MisLocations[MisRand][LoadX];

y = MisLocations[MisRand][LoadY];

z = MisLocations[MisRand][LoadZ];

unx[playerid] = MisLocations[MisRand][unloadX];

uny[playerid] = MisLocations[MisRand][unloadY];

unz[playerid] = MisLocations[MisRand][unloadZ];

iPay[playerid] = MisLocations[MisRand][Pay];

SetPlayerCheckpoint(playerid, x, y, z, 7);

format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);

SendClientMessage(playerid, COLOR_GREEN, "Mission:");

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

SendClientMessage(playerid, COLOR_GREEN, "");

SendClientMessage(playerid, 0xFFFFFFFF, LoadText);

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You must be in a Plane to perform this!");

}

return 1;

}

stock StopWork(playerid)

{

DisablePlayerCheckpoint(playerid);

SendClientMessage(playerid, COLOR_RED, "You chose to cancel the mission and got fined $100");

GivePlayerMoney(playerid, -100);

MissionStatus[playerid] = 0;

return 1;

}

public OnPlayerEnterCheckpoint(playerid)

{

CheckpointEntered(playerid);

return 1;

}

stock CheckpointEntered(playerid)

{

new gString[128];

new vID = GetPlayerVehicleID(playerid);

if (!IsTrailerAttachedToVehicle(vID)) return SendClientMessage(playerid, COLOR_RED, "You need a trailer to unload!");

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_GREEN, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+2);

MissionStatus[playerid] = 0;

}

return 1;

}

stock pName(PN)

{

new PX[MAX_PLAYER_NAME];

GetPlayerName(PN, PX, sizeof(PX));

return PX;

}[/pawn]

560x95_F01616_1625F2_030303_000000.png
Link to comment
Share on other sites

Sar putea sa iei Warn pentru dublu post , si pune in loc de vID , id'ul de la masina respectiva care sa aibe acel trailer

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Nu merge, imi da:

C:\Documents and Settings\SkyNet\Desktop\Untitled.pwn(206) : warning 204: symbol is assigned a value that is never used: "vID"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Warning.

[pawn]#include <a_samp>

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define COLOR_ORANGE 0xFFA500FF

#define COLOR_LIMEGREEN 0x32CD32FF

#define COLOR_ROYALBLUE 0x4169E1FF

#define COLOR_SALMON 0xFA8072FF

#define COLOR_GREY 0xAFAFAFAA

#define COLOR_GREEN 0x33AA33AA

#define COLOR_RED 0xAA3333AA

#define COLOR_YELLOW 0xFFFF00AA

#define COLOR_WHITE 0xFFFFFFAA

#define COLOR_BLUE 0x0000BBAA

#define COLOR_LIGHTBLUE 0x33CCFFAA

#define COLOR_RED 0xAA3333AA

enum MisLocationsEnum

{

ID,

LoadName[128],

Float:LoadX,

Float:LoadY,

Float:LoadZ,

Float:UnloadX,

Float:UnloadY,

Float:UnloadZ,

Pay

}

new MisLocations[][MisLocationsEnum] =

{

{0, "Beer from Red County Brewery to Bone County Diner",-24.4073,-281.8898,5.9985,-305.4319,1315.6797,54.6189, 5980},

{1, "Fuel from LV Oil Refinery to LV Dirtring",266.8981,1416.5417,10.2001,1097.5164,1741.7422,10.5474, 5700},

{2, "Vehicle Parts from SF Airport ATC to Wang Cars",-1268.8223,13.6925,14.8682,-1986.3477,253.9728,35.8985, 3000},

{3, "Fuel from SF Oil Refinery to RS Haul",-1016.3634,-688.2434,32.7284,-55.3397,-1138.2479,0.8052, 18770}

};

#define TEAM_TRUCKER 1

#define TEAM_PILOT 2

new iMissionText[512][MAX_PLAYERS], Float:unx[MAX_PLAYERS], Float:uny[MAX_PLAYERS], Float:unz[MAX_PLAYERS], iPay[MAX_PLAYERS], MissionStatus[MAX_PLAYERS];

main(){}

public OnGameModeInit()

{

AddPlayerClass(72, -2105.3228, -124.2982, 37.2531, 0.0, 0,0,0,0,0,0);//Trucker - SF

AddPlayerClass(98, -2105.3228, -124.2982, 37.2531, 0.0, 0,0,0,0,0,0);//Trucker - SF

AddStaticVehicle(515,-1429.2000,-299.8479,15.0205,227.3141,1,1); // tir

AddStaticVehicle(435,-1444.9415,-287.5022,14.6383,231.9411,1,1); // remorca

AddStaticVehicle(511,-2125.8181,-128.2662,35.3203,175.6829,1,1); // Plane

AddStaticVehicle(511,-2070.8518,-77.0231,35.3203,271.2773,1,1); //Plane

return 1;

}

public OnPlayerRequestClass(playerid, classid)

{

switch (classid)

{

case 0:

{

GameTextForPlayer(playerid, "Trucker", 3000, 4);

SetPlayerTeam(playerid, TEAM_TRUCKER);

}

case 1:

{

    GameTextForPlayer(playerid, "Pilot", 3000, 3);

    SetPlayerTeam(playerid, TEAM_PILOT);

}

}

return 1;

}

public OnPlayerSpawn(playerid)

{

if(GetPlayerTeam(playerid) == TEAM_TRUCKER)

{

SetPlayerColor(playerid, COLOR_GREEN);

}

if(GetPlayerTeam(playerid) == TEAM_PILOT)

{

    SetPlayerColor(playerid, COLOR_RED);

}

return 1;

}

public OnPlayerCommandText(playerid, cmdtext[])

{

if (strcmp("/kill", cmdtext, true, 5) == 0)

{

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

return 1;

}

dcmd(work, 4, cmdtext);

dcmd(stopwork, 8, cmdtext);

return 0;

}

dcmd_work(playerid, params[])

{

#pragma unused params

if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return T_NewJob(playerid);

if(GetPlayerTeam(playerid) == TEAM_PILOT) return T_NewJob2(playerid);

return 1;

}

dcmd_stopwork(playerid, params[])

{

    #pragma unused params

if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return StopWork(playerid);

if(GetPlayerTeam(playerid) == TEAM_PILOT) return StopWork(playerid);

return 1;

}

stock T_NewJob(playerid)

{

    new vID = GetPlayerVehicleID(playerid);

if(GetVehicleModel(vID)== 403 || GetVehicleModel(vID)== 515 || GetVehicleModel(vID)== 593 || GetVehicleModel(vID) == 514)

{

    if(IsTrailerAttachedToVehicle(vID))

    {

    MissionStatus[playerid] = 1;

    new MisRand = random(sizeof(MisLocations));

new LoadText[128], Float:x, Float:y, Float:z;

x = MisLocations[MisRand][LoadX];

y = MisLocations[MisRand][LoadY];

z = MisLocations[MisRand][LoadZ];

unx[playerid] = MisLocations[MisRand][unloadX];

uny[playerid] = MisLocations[MisRand][unloadY];

unz[playerid] = MisLocations[MisRand][unloadZ];

iPay[playerid] = MisLocations[MisRand][Pay];

SetPlayerCheckpoint(playerid, x, y, z, 7);

format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);

SendClientMessage(playerid, COLOR_GREEN, "Mission:");

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

SendClientMessage(playerid, COLOR_GREEN, "");

SendClientMessage(playerid, 0xFFFFFFFF, LoadText);

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

}

else

{

SendClientMessage(playerid, COLOR_RED, "You need a trailer!");

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You must be in a Truck to perform this!");

}

return 1;

}

stock T_NewJob2(playerid)

{

    new vID = GetPlayerVehicleID(playerid);

if(GetVehicleModel(vID)== 511 || GetVehicleModel(vID)== 519 || GetVehicleModel(vID) == 553)

{

    MissionStatus[playerid] = 1;

    new MisRand = random(sizeof(MisLocations));

new LoadText[128], Float:x, Float:y, Float:z;

x = MisLocations[MisRand][LoadX];

y = MisLocations[MisRand][LoadY];

z = MisLocations[MisRand][LoadZ];

unx[playerid] = MisLocations[MisRand][unloadX];

uny[playerid] = MisLocations[MisRand][unloadY];

unz[playerid] = MisLocations[MisRand][unloadZ];

iPay[playerid] = MisLocations[MisRand][Pay];

SetPlayerCheckpoint(playerid, x, y, z, 7);

format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);

SendClientMessage(playerid, COLOR_GREEN, "Mission:");

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

SendClientMessage(playerid, COLOR_GREEN, "");

SendClientMessage(playerid, 0xFFFFFFFF, LoadText);

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You must be in a Plane to perform this!");

}

return 1;

}

stock StopWork(playerid)

{

DisablePlayerCheckpoint(playerid);

SendClientMessage(playerid, COLOR_RED, "You chose to cancel the mission and got fined $100");

GivePlayerMoney(playerid, -100);

MissionStatus[playerid] = 0;

return 1;

}

public OnPlayerEnterCheckpoint(playerid)

{

CheckpointEntered(playerid);

return 1;

}

stock CheckpointEntered(playerid)

{

new gString[128];

new vID = GetPlayerVehicleID(playerid);

if (!IsTrailerAttachedToVehicle(515)) return SendClientMessage(playerid, COLOR_RED, "You need a trailer to unload!");

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_GREEN, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+2);

MissionStatus[playerid] = 0;

}

return 1;

}

stock pName(PN)

{

new PX[MAX_PLAYER_NAME];

GetPlayerName(PN, PX, sizeof(PX));

return PX;

}[/pawn]

560x95_F01616_1625F2_030303_000000.png
Link to comment
Share on other sites

vID trebuie sa fie definit sau stock or ceva dane tot unde scrie vID

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Stock Trucker:

[pawn]stock CheckpointEntered(playerid)

{

new gString[128];

new vID = GetPlayerVehicleID(playerid);

if (!IsTrailerAttachedToVehicle(vID)) return SendClientMessage(playerid, COLOR_RED, "You need a trailer to unload!");

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_LIGHTBLUE, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+2);

MissionStatus[playerid] = 0;

}

return 1;

}[/pawn]

Stock Pilot:

[pawn]stock CheckpointEnteredTEAM_PILOT(playerid)

{

new gString[128];

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_LIGHTBLUE, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+5);

MissionStatus[playerid] = 0;

}

return 1;

}[/pawn]

FS-ul intreg:

[pawn]#include <a_samp>

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define COLOR_ORANGE 0xFFA500FF

#define COLOR_LIMEGREEN 0x32CD32FF

#define COLOR_ROYALBLUE 0x4169E1FF

#define COLOR_SALMON 0xFA8072FF

#define COLOR_GREY 0xAFAFAFAA

#define COLOR_GREEN 0x33AA33AA

#define COLOR_RED 0xAA3333AA

#define COLOR_YELLOW 0xFFFF00AA

#define COLOR_WHITE 0xFFFFFFAA

#define COLOR_BLUE 0x0000BBAA

#define COLOR_LIGHTBLUE 0x33CCFFAA

#define COLOR_RED 0xAA3333AA

enum MisLocationsEnum

{

ID,

LoadName[128],

Float:LoadX,

Float:LoadY,

Float:LoadZ,

Float:UnloadX,

Float:UnloadY,

Float:UnloadZ,

Pay

}

new MisLocations[][MisLocationsEnum] =

{

{0, "Beer from Red County Brewery to Bone County Diner",-24.4073,-281.8898,5.9985,-305.4319,1315.6797,54.6189, 5980},

{1, "Fuel from LV Oil Refinery to LV Dirtring",266.8981,1416.5417,10.2001,1097.5164,1741.7422,10.5474, 5700},

{2, "Vehicle Parts from SF Airport ATC to Wang Cars",-1268.8223,13.6925,14.8682,-1986.3477,253.9728,35.8985, 3000},

{3, "Fuel from SF Oil Refinery to RS Haul",-1016.3634,-688.2434,32.7284,-55.3397,-1138.2479,0.8052, 18770}

};

#define TEAM_TRUCKER 1

#define TEAM_PILOT 2

new iMissionText[512][MAX_PLAYERS], Float:unx[MAX_PLAYERS], Float:uny[MAX_PLAYERS], Float:unz[MAX_PLAYERS], iPay[MAX_PLAYERS], MissionStatus[MAX_PLAYERS];

main(){}

public OnGameModeInit()

{

AddPlayerClass(72, -2105.3228, -124.2982, 37.2531, 0.0, 0,0,0,0,0,0);//Trucker - SF

AddPlayerClass(98, -2105.3228, -124.2982, 37.2531, 0.0, 0,0,0,0,0,0);//Trucker - SF

AddStaticVehicle(515,-1429.2000,-299.8479,15.0205,227.3141,1,1); // tir

AddStaticVehicle(435,-1444.9415,-287.5022,14.6383,231.9411,1,1); // remorca

AddStaticVehicle(511,-2125.8181,-128.2662,35.3203,175.6829,1,1); // Plane

AddStaticVehicle(511,-2070.8518,-77.0231,35.3203,271.2773,1,1); //Plane

return 1;

}

public OnPlayerRequestClass(playerid, classid)

{

switch (classid)

{

case 0:

{

GameTextForPlayer(playerid, "Trucker", 3000, 4);

SetPlayerTeam(playerid, TEAM_TRUCKER);

}

case 1:

{

    GameTextForPlayer(playerid, "Pilot", 3000, 3);

    SetPlayerTeam(playerid, TEAM_PILOT);

}

}

return 1;

}

public OnPlayerSpawn(playerid)

{

if(GetPlayerTeam(playerid) == TEAM_TRUCKER)

{

SetPlayerColor(playerid, COLOR_GREEN);

}

if(GetPlayerTeam(playerid) == TEAM_PILOT)

{

    SetPlayerColor(playerid, COLOR_RED);

}

return 1;

}

public OnPlayerCommandText(playerid, cmdtext[])

{

if (strcmp("/kill", cmdtext, true, 5) == 0)

{

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

return 1;

}

dcmd(work, 4, cmdtext);

dcmd(stopwork, 8, cmdtext);

return 0;

}

dcmd_work(playerid, params[])

{

#pragma unused params

if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return T_NewJob(playerid);

if(GetPlayerTeam(playerid) == TEAM_PILOT) return T_NewJob2(playerid);

return 1;

}

dcmd_stopwork(playerid, params[])

{

    #pragma unused params

if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return StopWork(playerid);

if(GetPlayerTeam(playerid) == TEAM_PILOT) return StopWork(playerid);

return 1;

}

stock T_NewJob(playerid)

{

    new vID = GetPlayerVehicleID(playerid);

if(GetVehicleModel(vID)== 403 || GetVehicleModel(vID)== 515 || GetVehicleModel(vID)== 593 || GetVehicleModel(vID) == 514)

{

    if(IsTrailerAttachedToVehicle(vID))

    {

    MissionStatus[playerid] = 1;

    new MisRand = random(sizeof(MisLocations));

new LoadText[128], Float:x, Float:y, Float:z;

x = MisLocations[MisRand][LoadX];

y = MisLocations[MisRand][LoadY];

z = MisLocations[MisRand][LoadZ];

unx[playerid] = MisLocations[MisRand][unloadX];

uny[playerid] = MisLocations[MisRand][unloadY];

unz[playerid] = MisLocations[MisRand][unloadZ];

iPay[playerid] = MisLocations[MisRand][Pay];

SetPlayerCheckpoint(playerid, x, y, z, 7);

format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);

SendClientMessage(playerid, COLOR_GREEN, "Mission:");

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

SendClientMessage(playerid, COLOR_GREEN, "");

SendClientMessage(playerid, 0xFFFFFFFF, LoadText);

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

}

else

{

SendClientMessage(playerid, COLOR_RED, "You need a trailer!");

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You must be in a Truck to perform this!");

}

return 1;

}

stock T_NewJob2(playerid)

{

    new vID = GetPlayerVehicleID(playerid);

if(GetVehicleModel(vID)== 511 || GetVehicleModel(vID)== 519 || GetVehicleModel(vID) == 553)

{

    MissionStatus[playerid] = 1;

    new MisRand = random(sizeof(MisLocations));

new LoadText[128], Float:x, Float:y, Float:z;

x = MisLocations[MisRand][LoadX];

y = MisLocations[MisRand][LoadY];

z = MisLocations[MisRand][LoadZ];

unx[playerid] = MisLocations[MisRand][unloadX];

uny[playerid] = MisLocations[MisRand][unloadY];

unz[playerid] = MisLocations[MisRand][unloadZ];

iPay[playerid] = MisLocations[MisRand][Pay];

SetPlayerCheckpoint(playerid, x, y, z, 7);

format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);

SendClientMessage(playerid, COLOR_GREEN, "Mission:");

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

SendClientMessage(playerid, COLOR_GREEN, "");

SendClientMessage(playerid, 0xFFFFFFFF, LoadText);

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You must be in a Plane to perform this!");

}

return 1;

}

stock StopWork(playerid)

{

DisablePlayerCheckpoint(playerid);

SendClientMessage(playerid, COLOR_RED, "You chose to cancel the mission and got fined $100");

GivePlayerMoney(playerid, -100);

MissionStatus[playerid] = 0;

return 1;

}

public OnPlayerEnterCheckpoint(playerid)

{

CheckpointEntered(playerid);

CheckpointEnteredTEAM_PILOT(playerid);

return 1;

}

stock CheckpointEntered(playerid)

{

new gString[128];

new vID = GetPlayerVehicleID(playerid);

if (!IsTrailerAttachedToVehicle(vID)) return SendClientMessage(playerid, COLOR_RED, "You need a trailer to unload!");

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_LIGHTBLUE, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+2);

MissionStatus[playerid] = 0;

}

return 1;

}

stock CheckpointEnteredTEAM_PILOT(playerid)

{

new gString[128];

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_LIGHTBLUE, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+5);

MissionStatus[playerid] = 0;

}

return 1;

}

stock pName(PN)

{

new PX[MAX_PLAYER_NAME];

GetPlayerName(PN, PX, sizeof(PX));

return PX;

}[/pawn]

560x95_F01616_1625F2_030303_000000.png
Link to comment
Share on other sites

Stock Trucker:

[pawn]stock CheckpointEntered(playerid)

{

new gString[128];

new vID = GetPlayerVehicleID(playerid);

if (!IsTrailerAttachedToVehicle(vID)) return SendClientMessage(playerid, COLOR_RED, "You need a trailer to unload!");

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_LIGHTBLUE, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+2);

MissionStatus[playerid] = 0;

}

return 1;

}[/pawn]

Stock Pilot:

[pawn]stock CheckpointEnteredTEAM_PILOT(playerid)

{

new gString[128];

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_LIGHTBLUE, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+5);

MissionStatus[playerid] = 0;

}

return 1;

}[/pawn]

FS-ul intreg:

[pawn]#include <a_samp>

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define COLOR_ORANGE 0xFFA500FF

#define COLOR_LIMEGREEN 0x32CD32FF

#define COLOR_ROYALBLUE 0x4169E1FF

#define COLOR_SALMON 0xFA8072FF

#define COLOR_GREY 0xAFAFAFAA

#define COLOR_GREEN 0x33AA33AA

#define COLOR_RED 0xAA3333AA

#define COLOR_YELLOW 0xFFFF00AA

#define COLOR_WHITE 0xFFFFFFAA

#define COLOR_BLUE 0x0000BBAA

#define COLOR_LIGHTBLUE 0x33CCFFAA

#define COLOR_RED 0xAA3333AA

enum MisLocationsEnum

{

ID,

LoadName[128],

Float:LoadX,

Float:LoadY,

Float:LoadZ,

Float:UnloadX,

Float:UnloadY,

Float:UnloadZ,

Pay

}

new MisLocations[][MisLocationsEnum] =

{

{0, "Beer from Red County Brewery to Bone County Diner",-24.4073,-281.8898,5.9985,-305.4319,1315.6797,54.6189, 5980},

{1, "Fuel from LV Oil Refinery to LV Dirtring",266.8981,1416.5417,10.2001,1097.5164,1741.7422,10.5474, 5700},

{2, "Vehicle Parts from SF Airport ATC to Wang Cars",-1268.8223,13.6925,14.8682,-1986.3477,253.9728,35.8985, 3000},

{3, "Fuel from SF Oil Refinery to RS Haul",-1016.3634,-688.2434,32.7284,-55.3397,-1138.2479,0.8052, 18770}

};

#define TEAM_TRUCKER 1

#define TEAM_PILOT 2

new iMissionText[512][MAX_PLAYERS], Float:unx[MAX_PLAYERS], Float:uny[MAX_PLAYERS], Float:unz[MAX_PLAYERS], iPay[MAX_PLAYERS], MissionStatus[MAX_PLAYERS];

main(){}

public OnGameModeInit()

{

AddPlayerClass(72, -2105.3228, -124.2982, 37.2531, 0.0, 0,0,0,0,0,0);//Trucker - SF

AddPlayerClass(98, -2105.3228, -124.2982, 37.2531, 0.0, 0,0,0,0,0,0);//Trucker - SF

AddStaticVehicle(515,-1429.2000,-299.8479,15.0205,227.3141,1,1); // tir

AddStaticVehicle(435,-1444.9415,-287.5022,14.6383,231.9411,1,1); // remorca

AddStaticVehicle(511,-2125.8181,-128.2662,35.3203,175.6829,1,1); // Plane

AddStaticVehicle(511,-2070.8518,-77.0231,35.3203,271.2773,1,1); //Plane

return 1;

}

public OnPlayerRequestClass(playerid, classid)

{

switch (classid)

{

case 0:

{

GameTextForPlayer(playerid, "Trucker", 3000, 4);

SetPlayerTeam(playerid, TEAM_TRUCKER);

}

case 1:

{

    GameTextForPlayer(playerid, "Pilot", 3000, 3);

    SetPlayerTeam(playerid, TEAM_PILOT);

}

}

return 1;

}

public OnPlayerSpawn(playerid)

{

if(GetPlayerTeam(playerid) == TEAM_TRUCKER)

{

SetPlayerColor(playerid, COLOR_GREEN);

}

if(GetPlayerTeam(playerid) == TEAM_PILOT)

{

    SetPlayerColor(playerid, COLOR_RED);

}

return 1;

}

public OnPlayerCommandText(playerid, cmdtext[])

{

if (strcmp("/kill", cmdtext, true, 5) == 0)

{

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

return 1;

}

dcmd(work, 4, cmdtext);

dcmd(stopwork, 8, cmdtext);

return 0;

}

dcmd_work(playerid, params[])

{

#pragma unused params

if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return T_NewJob(playerid);

if(GetPlayerTeam(playerid) == TEAM_PILOT) return T_NewJob2(playerid);

return 1;

}

dcmd_stopwork(playerid, params[])

{

    #pragma unused params

if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return StopWork(playerid);

if(GetPlayerTeam(playerid) == TEAM_PILOT) return StopWork(playerid);

return 1;

}

stock T_NewJob(playerid)

{

    new vID = GetPlayerVehicleID(playerid);

if(GetVehicleModel(vID)== 403 || GetVehicleModel(vID)== 515 || GetVehicleModel(vID)== 593 || GetVehicleModel(vID) == 514)

{

    if(IsTrailerAttachedToVehicle(vID))

    {

    MissionStatus[playerid] = 1;

    new MisRand = random(sizeof(MisLocations));

new LoadText[128], Float:x, Float:y, Float:z;

x = MisLocations[MisRand][LoadX];

y = MisLocations[MisRand][LoadY];

z = MisLocations[MisRand][LoadZ];

unx[playerid] = MisLocations[MisRand][unloadX];

uny[playerid] = MisLocations[MisRand][unloadY];

unz[playerid] = MisLocations[MisRand][unloadZ];

iPay[playerid] = MisLocations[MisRand][Pay];

SetPlayerCheckpoint(playerid, x, y, z, 7);

format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);

SendClientMessage(playerid, COLOR_GREEN, "Mission:");

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

SendClientMessage(playerid, COLOR_GREEN, "");

SendClientMessage(playerid, 0xFFFFFFFF, LoadText);

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

}

else

{

SendClientMessage(playerid, COLOR_RED, "You need a trailer!");

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You must be in a Truck to perform this!");

}

return 1;

}

stock T_NewJob2(playerid)

{

    new vID = GetPlayerVehicleID(playerid);

if(GetVehicleModel(vID)== 511 || GetVehicleModel(vID)== 519 || GetVehicleModel(vID) == 553)

{

    MissionStatus[playerid] = 1;

    new MisRand = random(sizeof(MisLocations));

new LoadText[128], Float:x, Float:y, Float:z;

x = MisLocations[MisRand][LoadX];

y = MisLocations[MisRand][LoadY];

z = MisLocations[MisRand][LoadZ];

unx[playerid] = MisLocations[MisRand][unloadX];

uny[playerid] = MisLocations[MisRand][unloadY];

unz[playerid] = MisLocations[MisRand][unloadZ];

iPay[playerid] = MisLocations[MisRand][Pay];

SetPlayerCheckpoint(playerid, x, y, z, 7);

format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);

SendClientMessage(playerid, COLOR_GREEN, "Mission:");

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

SendClientMessage(playerid, COLOR_GREEN, "");

SendClientMessage(playerid, 0xFFFFFFFF, LoadText);

SendClientMessage(playerid, COLOR_GREEN, "_____________________");

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You must be in a Plane to perform this!");

}

return 1;

}

stock StopWork(playerid)

{

DisablePlayerCheckpoint(playerid);

SendClientMessage(playerid, COLOR_RED, "You chose to cancel the mission and got fined $100");

GivePlayerMoney(playerid, -100);

MissionStatus[playerid] = 0;

return 1;

}

public OnPlayerEnterCheckpoint(playerid)

{

CheckpointEntered(playerid);

CheckpointEnteredTEAM_PILOT(playerid);

return 1;

}

stock CheckpointEntered(playerid)

{

new gString[128];

new vID = GetPlayerVehicleID(playerid);

if (!IsTrailerAttachedToVehicle(vID)) return SendClientMessage(playerid, COLOR_RED, "You need a trailer to unload!");

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_LIGHTBLUE, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+2);

MissionStatus[playerid] = 0;

}

return 1;

}

stock CheckpointEnteredTEAM_PILOT(playerid)

{

new gString[128];

if(MissionStatus[playerid] == 1)

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);

SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");

MissionStatus[playerid] = 2;

}

    else if(MissionStatus[playerid] == 2)

{

DisablePlayerCheckpoint(playerid);

GivePlayerMoney(playerid, iPay[playerid]);

SendClientMessage(playerid, COLOR_LIGHTBLUE, "Well done! You completed the mission!");

format(gString, 512, "%s has completed mission: %s", pName(playerid), iMissionText[playerid]);

SendClientMessageToAll(COLOR_GREEN, gString);

SetPlayerScore(playerid, GetPlayerScore(playerid)+5);

MissionStatus[playerid] = 0;

}

return 1;

}

stock pName(PN)

{

new PX[MAX_PLAYER_NAME];

GetPlayerName(PN, PX, sizeof(PX));

return PX;

}[/pawn]

Ma frate eu nu te mai inteleg ce vrei.Neai dat FS-ul cand ai postat prima data,acum nil dai din nou ce vrei sa facem cu el:|

 

 

Link to comment
Share on other sites

incearca

stock CheckpointEntered(playerid)
{
	new gString[128];
	new vID = GetPlayerVehicleID(playerid);
	if(GetVehicleModel(vID)== 403 || GetVehicleModel(vID)== 515 || GetVehicleModel(vID)== 593 || GetVehicleModel(vID) == 514)
	if (!IsTrailerAttachedToVehicle(vID)) return SendClientMessage(playerid, COLOR_RED, "You need a trailer to unload!");
	if(MissionStatus[playerid] == 1)
	{
		DisablePlayerCheckpoint(playerid);
		SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);
		SendClientMessage(playerid, COLOR_ORANGE, "Loaded. Please head to the second checkpoint!");
		MissionStatus[playerid] = 2;
	}

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

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.