PHP код:
//include
#include <a_samp>
//define
#define COLOR_DARKGOLD 0x808000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
//CP_job
#define Checkpoint1 -1647.900,28.1000,3.2000
#define Checkpoint2 -231.8289,-1467.9810,4.9421
//new
new jobrunning = 0;
new more;
//forward
forward GivePlayerOneExp(playerid);
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" kar kamiyon");
print("--------------------------------------\n");
//more (CreatePickup)
more = CreatePickup(1254,2,-1634.900, 67.699, 3.200,-1);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" kar kamiyon");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
//trucks
CreateVehicle(515, -1587.7993, 111.5746, 4.8161, 226.8379, -1, -1, 100);
CreateVehicle(515, -1592.3186, 107.2265, 4.8901, 228.0000, -1, -1, 100);
CreateVehicle(515, -1596.6328, 103.0799, 4.7612, 227.8919, -1, -1, 100);
//trilers
CreateVehicle(584, -1582.6169, 79.4110, 5.4753, 0.0000, -1, -1, 100);
CreateVehicle(435, -1589.7299, 80.2774, 5.4753, 0.0000, -1, -1, 100);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(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("/bar", cmdtext, true, 10) == 0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 515)
{
if(GetVehicleTrailer(GetPlayerVehicleID(playerid))) SendClientMessage(playerid, COLOR_YELLOW, "Shoma Trailer Darid");
else SendClientMessage(playerid, COLOR_RED, "Shoma Trailer Nadarid");
SetPlayerCheckpoint(playerid, Checkpoint1, 3.0);
jobrunning = 1;
GameTextForPlayer(playerid, "~g~Shoma Kar Ra shoro Kardid Movafagh Bashid kargar zahmatkesh...", 3000, 3);
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "ranandeye por kar %s dar hale haml bar ast .", name );
SendClientMessageToAll(COLOR_RED, string);
return 1;
}
SendClientMessage(playerid, COLOR_RED,"Shoma mitavanid Mashine Haml Bar Ra Ke Nar Khalij peyda konid (age peyda nakardid az adminha beporsid)...");
}
if (strcmp("/kamiyonhelp", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "Shoma bayad bar ra noghteye moredenazar bebarid.");
SendClientMessage(playerid, COLOR_YELLOW, "az mashin piyade nashid.");
SendClientMessage(playerid, COLOR_YELLOW, "Poli ke az in kar be dast miavarid = 55000$.");
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 515)
{
SendClientMessage(playerid, COLOR_RED, "Bar ra bardarid va be noghteye ghermez beravid");
}
return 0;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if((jobrunning) == 1)
{
jobrunning = 0;
SendClientMessage(playerid, COLOR_RED, "shoma nabayad piyyade mishodid az mashine keshavarzi va bayad dobare savar shid va bezanid /bar.");
}else if((jobrunning) == 0){
//Nothing
}
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 515)
{
if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint1))
{
SetPlayerCheckpoint(playerid, Checkpoint2, 7.0);
}
if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint2))
{
GivePlayerMoney(playerid, 50000);
GameTextForPlayer(playerid, "~g~Tabrik Shoma kar Ra tamam kardid va $55000 Gereftid", 3000, 3);
SetVehicleToRespawn(2);
jobrunning = 0;
DisablePlayerCheckpoint(playerid);
DetachTrailerFromVehicle(435 && 584);
DestroyVehicle(435 && 584);
}
}
}
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)
{
if(pickupid == more)
{
GameTextForPlayer(playerid, "~g~baraye etelaate bishtar darbareye kar bezanid /kamiyonhelp", 3000, 3);
}
}
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;
}