Sweeper[rep]
#1

i made a thingy and how can i make it so if i enter sweeper it shows me automaticly the checkpoint so i dont do /matura each time.!(/matura = sweep)

PHP Code:
    if(strcmp(cmd"/matura"true) == 0)
                {
                   if(
PlayerInfo[playerid][pJob] >= 18)
                {
                if(
IsPlayerConnected(playerid))
                {
                    new 
newcar GetPlayerVehicleID(playerid);
                    if(
IsASweeper(newcar))
                     {
                        
CP[playerid] = 78;
                           
SetPlayerCheckpoint(playerid1195.8503,-1324.3208,13.12363.0);
                           
SendClientMessage(playeridCOLOR_YELLOW,"Strazile sunt de mult nematurate..");
                    }
                }
                }
                else
                {
                return 
1;
                }
                } 
Reply
#2

Add this OnPlayerEnterVehicle ?
pawn Code:
if(PlayerInfo[playerid][pJob] >= 18)
{
    if(IsPlayerConnected(playerid)) {
        new newcar = GetPlayerVehicleID(playerid);
        if(IsASweeper(newcar)) {
            CP[playerid] = 78;
            SetPlayerCheckpoint(playerid, 1195.8503,-1324.3208,13.1236, 3.0);
            SendClientMessage(playerid, COLOR_YELLOW,"Strazile sunt de mult nematurate..");
        }
    }
Reply
#3

i did like this and somehow not responding..
Reply
#4

what else do you have under 'onplayerentervehicle'
Reply
#5

PHP Code:
    public OnPlayerEnterVehicle(playeridvehicleidispassenger)
                {
                new 
plname[MAX_PLAYER_NAME];
                
GetPlayerName(playeridplnamesizeof(plname));
                new 
string[128];
                new 
vehicle[24];
                
GetVehicleName(vehicleidvehiclesizeof(vehicle));
                if(
IsAGangCar7(vehicleid))
                {
                
format(string,sizeof(string),"You are entering to a %s (%d)   Owner: Hitman",vehiclevehicleid);
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                }
                else if(
IsACopCar(vehicleid))
                {
                
format(string,sizeof(string),"You are entering to a %s (%d)   Owner: L.S.P.D",vehiclevehicleid);
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                }
                else if(
IsATaxiCar(vehicleid))
                {
                
format(string,sizeof(string),"You are entering to a %s (%d)   Owner: Taxi Company",vehiclevehicleid);
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                }
                else if(
IsATowCar(vehicleid))
                {
                
format(string,sizeof(string),"You are entering to a %s (%d)   Owner: Tow Company",vehiclevehicleid);
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                }
                else if(
IsASweeper(vehicleid))
                {
                
format(string,sizeof(string),"You are entering to a %s (%d)   Owner: Sweeper",vehiclevehicleid);
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                }
                else if(
IsANrCar(vehicleid))
                {
                
format(string,sizeof(string),"You are entering to a %s (%d)   Owner: News Reporter",vehiclevehicleid);
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                }
                else if(
IsAYepCar(vehicleid))
                {
                
format(string,sizeof(string),"You are entering to a %s (%d)   Owner: Mafia Napoletana",vehiclevehicleid);
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                }
                else if(
IsAMSCar(vehicleid))
                {
                
format(string,sizeof(string),"You are entering to a %s (%d)   Owner: MS-13",vehiclevehicleid);
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                }
                } 
Reply
#6

pawn Code:
else if(IsASweeper(vehicleid))
{
   format(string,sizeof(string),"You are entering to a %s (%d)   Owner: Sweeper",vehicle, vehicleid);
   SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
Change to :
pawn Code:
else if(IsASweeper(vehicleid))
{
    if(PlayerInfo[playerid][pJob] >= 18)
    {
        CP[playerid] = 78;
        SetPlayerCheckpoint(playerid, 1195.8503,-1324.3208,13.1236, 3.0);
        SendClientMessage(playerid, COLOR_YELLOW,"Strazile sunt de mult nematurate..");
        format(string,sizeof(string),"You are entering to a  %s (%d)   Owner: Sweeper",vehicle, vehicleid);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        return 1;
    }
    format(string,sizeof(string),"You are entering to a %s (%d)   Owner: Sweeper",vehicle, vehicleid);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    return 1;
}
Reply
#7

pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
                new plname[MAX_PLAYER_NAME];
                GetPlayerName(playerid, plname, sizeof(plname));
                new string[128];
                new vehicle[24];
                GetVehicleName(vehicleid, vehicle, sizeof(vehicle));
                if(IsASweeper(vehicleid))  
                {
                if(PlayerInfo[playerid][pJob] >= 18)
                    {
                        CP[playerid] = 78;
                        SetPlayerCheckpoint(playerid, 1195.8503,-1324.3208,13.1236, 3.0);
                        SendClientMessage(playerid, COLOR_YELLOW,"Strazile sunt de mult nematurate..");
                        }
                    }
                if(IsAGangCar7(vehicleid))
                {
                format(string,sizeof(string),"You are entering to a %s (%d)   Owner: Hitman",vehicle, vehicleid);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
                else if(IsACopCar(vehicleid))
                {
                format(string,sizeof(string),"You are entering to a %s (%d)   Owner: L.S.P.D",vehicle, vehicleid);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
                else if(IsATaxiCar(vehicleid))
                {
                format(string,sizeof(string),"You are entering to a %s (%d)   Owner: Taxi Company",vehicle, vehicleid);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
                else if(IsATowCar(vehicleid))
                {
                format(string,sizeof(string),"You are entering to a %s (%d)   Owner: Tow Company",vehicle, vehicleid);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
                else if(IsASweeper(vehicleid))
                {
                format(string,sizeof(string),"You are entering to a %s (%d)   Owner: Sweeper",vehicle, vehicleid);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
                else if(IsANrCar(vehicleid))
                {
                format(string,sizeof(string),"You are entering to a %s (%d)   Owner: News Reporter",vehicle, vehicleid);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
                else if(IsAYepCar(vehicleid))
                {
                format(string,sizeof(string),"You are entering to a %s (%d)   Owner: Mafia Napoletana",vehicle, vehicleid);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
                else if(IsAMSCar(vehicleid))
                {
                format(string,sizeof(string),"You are entering to a %s (%d)   Owner: MS-13",vehicle, vehicleid);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            }
    return 1;
    }
Reply
#8

i wanted at Onplayerstatechange.. i added this.

PHP Code:
 (6542) : warning 219local variable "newcar" shadows a variable at a preceding level 
i put this at onplayerstatechange

PHP Code:
if(PlayerInfo[playerid][pJob] >= 18)
                {
                if(
IsPlayerConnected(playerid)) {
        
LINE: (6542)         new newcar GetPlayerVehicleID(playerid);
                if(
IsASweeper(newcar)) {
                
CP[playerid] = 78;
                
SetPlayerCheckpoint(playerid1195.8503,-1324.3208,13.12363.0);
                
SendClientMessage(playeridCOLOR_YELLOW,"Strazile sunt de mult nematurate..");
                }
                } 
Reply
#9

want it at. OnPlayerEnterVehicle. Just replace your onplayerentervehicle with the one i posted and it should work
Reply
#10

i put that too not responding this..pawno
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)