Vehicles for jobs
#1

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
PHP код:
if(!strcmp(cmdtext"/startsweep"true))
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pJob] != 21)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You're not the street sweeper ! ");
                return 
1;
            }
            if(
PlayerIsSweeping[playerid] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You're sweeping streets already ! ");
                return 
1;
            }
            if(
IsASweeper(idcar))
            {
                
PlayerIsSweeping[playerid] = 1;
                
TogglePlayerControllable(playerid1);
                new 
randomize;
                
randomize random(sizeof(gSweeperPoints));
                
SetPlayerCheckpoint(playeridgSweeperPoints[randomize][0], gSweeperPoints[randomize][1], gSweeperPoints[randomize][2], 5.0);
                
SendClientMessage(playeridCOLOR_WHITE"Your working hours is up! Go to red checkpoint.");
                new 
ymd;
                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(playeridCOLOR_WHITE"You have stopped sweeping streets.");
                if(
IsASweeper(idcar))
                {
                    
SafeRemovePlayerFromVehicle(playerid);
                    new 
ymd;
                    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(playeridCOLOR_GREY"   You're not even sweeping ! ");
                return 
1;
            }
        }
        return 
1;
    } 
And here is vehicles what I want add to this job:
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 
What I have to do?
Reply
#2

ou have to add a command like to check that player is in a sweeper car or not
add this in ur command - >
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 574)return SendClientMessage(playerid,-1,"{ff0000}You need to be in a sweeper car to start this job");
Reply
#3

mm, I have this:
PHP код:
public IsASweeper(carid)
{
    new 
model GetVehicleModel(carid);
    if(
model == 574)
    {
        return 
1;
    }
    return 
0;

and when I'm InGame and enter to vehicle then I got message: /startsweep to start sweeping Type /exit to leave the sweeper. Then I write /startsweep but I can't turn engine on. I have to use /aengine.
Reply
#4

Some help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)