I've got this but i get the Driver License message.
#1

Hello, this is my code:
Quote:

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new bikes = (
581,
522,
461,
521,
463,
586,
468,
471
);

new planes = (
592,
577,
511,
512,
593,
520,
553,
476,
519,
460,
513
);

new boats = (
472,
473,
493,
595,
484,
430,
453,
452,
446,
454
);

new copfbivehicles = (
523,
430,
427,
490,
528,
596,
597,
598,
599,
601,
497
);

new ambulancevehicles = (
416,
487
);

new firevehicles = (
407,
544
);

if(GetPlayerVehicleID(playerid) == bikes) {
if(PlayerInfo[playerid][pDriveLic] == 0) {
SendClientMessage(playerid, COLOR_RED, "*** You don't have your driving license yet, take care or the Cops will notice. ((/gps_licensecenter))");
return 1;
}
}
if(GetPlayerVehicleID(playerid) == planes) {
if(PlayerInfo[playerid][pFlyLic] == 0) {
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
SendClientMessage(playerid, COLOR_RED, "*** You don't know how to fly yet, get your license at the License Center. ((/gps_licensecenter))");
return 1;
}
}
if(GetPlayerVehicleID(playerid) == boats) {
if(PlayerInfo[playerid][pSailLic] == 0) {
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
SendClientMessage(playerid, COLOR_RED, "*** You don't know how to sail yet, get your license at the License Center. ((/gps_licensecenter))");
return 1;
}
}
new model = GetPlayerVehicleID(playerid);
if(model != planes && model != boats) {
if(PlayerInfo[playerid][pDriveLic] == 0) {
SendClientMessage(playerid, COLOR_RED, "*** You don't have your driving license yet, take care or the Cops will notice. ((/gps_licensecenter))");
return 1;
}
}
if(GetPlayerVehicleID(playerid) == copfbivehicles) {
if(PlayerInfo[playerid][pFaction] != 1) {
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
SendClientMessage(playerid, COLOR_GRAD4, "*** You don't have the keys for this vehicle. ((COP/FBI))");
return 1;
}
}
if(GetPlayerVehicleID(playerid) == ambulancevehicles) {
if(PlayerInfo[playerid][pFaction] != 2) {
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
SendClientMessage(playerid, COLOR_GRAD4, "*** You don't have the keys for this vehicle. ((Medic))");
return 1;
}
}
if(GetPlayerVehicleID(playerid) == firevehicles) {
if(PlayerInfo[playerid][pFaction] != 3) {
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
SendClientMessage(playerid, COLOR_GRAD4, "*** You don't have the keys for this vehicle. ((Paramedic))");
return 1;
}
}
return 1;
}

When i enter the Police, Ambulance, Paramedic etc. vehicle it shows only:
*** You don't have your driving license yet, take care or the Cop will notice.
Instead of You don't have the keys..

What did i do wrong?
Reply
#2

Wheres the code that gives the player the licence? also its easier to read if u use [pawn] tags and not [code] or [quote].
Reply
#3

[quote=iggy1;790697]Wheres the code that gives the player the licence? also its easier to read if u use [pawn] tags and not [code] or
Quote:

.

The player gets the license from the City Hall..
Quote:

PlayerInfo[playerid][pDriveLic] = 1;

That give the license, but i mean the message..

So when the player enter a Police Car it needs to say
You don't have the key for this vehicle. But it send the
message that you don't have a license and it enters
instead of returning to the Float position that we got with Float:X, Y z, etc..
Reply
#4

Use
pawn Код:
SetPlayerPos(playerid, X, Y, Z+(Z+5));
or

pawn Код:
SetPlayerPos(playerid, X, Y, Z+5);
Reply
#5

Quote:
Originally Posted by Claude
Посмотреть сообщение
Use
pawn Код:
SetPlayerPos(playerid, X, Y, Z+(Z+5));
or

pawn Код:
SetPlayerPos(playerid, X, Y, Z+5);
Uhh..? That's no my problem..
But Thanks.. Can't someone test my script and they'll know
what the problem is..
Reply
#6

sure, send me ip when you're online.....
Reply
#7

You'll have to use "return"
Reply
#8

Quote:
Originally Posted by Claude
Посмотреть сообщение
You'll have to use "return"
Pardon? not sure what u mean.

Send me ur code if u want ill have a look also or pm me ip (either).
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)