Sweeper[rep] -
Dan_Barocu - 11.04.2012
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(playerid, 1195.8503,-1324.3208,13.1236, 3.0);
SendClientMessage(playerid, COLOR_YELLOW,"Strazile sunt de mult nematurate..");
}
}
}
else
{
return 1;
}
}
Re: Sweeper[rep] -
The__ - 11.04.2012
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..");
}
}
Re: Sweeper[rep] -
Dan_Barocu - 11.04.2012
i did like this and somehow not responding..
Re: Sweeper[rep] -
Marco_Valentine - 12.04.2012
what else do you have under 'onplayerentervehicle'
Re: Sweeper[rep] -
Dan_Barocu - 12.04.2012
PHP 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(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);
}
}
Re: Sweeper[rep] -
The__ - 12.04.2012
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;
}
Re: Sweeper[rep] -
Marco_Valentine - 12.04.2012
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;
}
Re: Sweeper[rep] -
Dan_Barocu - 12.04.2012
i wanted at Onplayerstatechange.. i added this.
PHP Code:
(6542) : warning 219: local 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(playerid, 1195.8503,-1324.3208,13.1236, 3.0);
SendClientMessage(playerid, COLOR_YELLOW,"Strazile sunt de mult nematurate..");
}
}
Re: Sweeper[rep] -
Marco_Valentine - 12.04.2012
want it at. OnPlayerEnterVehicle. Just replace your onplayerentervehicle with the one i posted and it should work
Re: Sweeper[rep] -
Dan_Barocu - 12.04.2012
i put that too not responding this..pawno