16.03.2014, 08:42
Hello I have some problem with jobs I use Europe Roleplay GM and I want to add vehicles to jobs. Here is One job: Street Sweeper
And here is vehicles what I want add to this job:
What I have to do?
PHP код:
if(!strcmp(cmdtext, "/startsweep", true))
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] != 21)
{
SendClientMessage(playerid, COLOR_GREY, " You're not the street sweeper ! ");
return 1;
}
if(PlayerIsSweeping[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You're sweeping streets already ! ");
return 1;
}
if(IsASweeper(idcar))
{
PlayerIsSweeping[playerid] = 1;
TogglePlayerControllable(playerid, 1);
new randomize;
randomize = random(sizeof(gSweeperPoints));
SetPlayerCheckpoint(playerid, gSweeperPoints[randomize][0], gSweeperPoints[randomize][1], gSweeperPoints[randomize][2], 5.0);
SendClientMessage(playerid, COLOR_WHITE, "Your working hours is up! Go to red checkpoint.");
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /startsweep",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
}
return 1;
}
if(!strcmp(cmdtext, "/stopsweep", true))
{
if(IsPlayerConnected(playerid))
{
if(PlayerIsSweeping[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
PlayerIsSweeping[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, "You have stopped sweeping streets.");
if(IsASweeper(idcar))
{
SafeRemovePlayerFromVehicle(playerid);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /stopsweep",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You're not even sweeping ! ");
return 1;
}
}
return 1;
}
PHP код:
Sweeper[0] = AddStaticVehicleEx(574,2002.2742,-1824.9497,13.2730,1.3590,3,0,-1); // Sweeper 1
Sweeper[1] = AddStaticVehicleEx(574,2006.8129,-1824.7672,13.2708,2.2680,3,0,-1); // Sweeper 2
Sweeper[2] = AddStaticVehicleEx(574,2011.0564,-1824.7449,13.2809,359.2584,3,0,-1); // Sweeper 3
Sweeper[3] = AddStaticVehicleEx(574,2016.0067,-1824.7452,13.2779,1.3978,3,0,-1); // Sweeper 4
Sweeper[4] = AddStaticVehicleEx(574,2020.5428,-1824.5449,13.2780,2.7749,3,0,-1); // Sweeper 5
Sweeper[5] = AddStaticVehicleEx(574,2025.3369,-1824.4265,13.2770,1.1391,3,0,-1); // Sweeper 6
Sweeper[6] = AddStaticVehicleEx(574,2030.2015,-1824.4265,13.2735,4.7288,3,0,-1); // Sweeper 7
Sweeper[7] = AddStaticVehicleEx(574,2034.7485,-1824.5200,13.2720,1.7881,3,0,-1); // Sweeper 8
Sweeper[8] = AddStaticVehicleEx(574,2039.5232,-1824.6814,13.2121,0.3286,3,0,-1); // Sweeper 9