How can i do that?
#1

Hello, i want to make my license system a bit easier to script..
Here's my script:

Quote:

new bike = GetVehicleModel(vehicleid);
new planes = GetVehicleModel(vehicleid);
new boats = GetVehicleModel(vehicleid);

if(bike == 581 || bike == 522 || bike == 461 || bike == 521 || bike == 463 || bike == 586 || bike == 468 || bike == 471) {
if(PlayerInfo[playerid][pDriveLic] == 0) {
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
SendClientMessage(playerid, COLOR_DARKRED, "*** You don't know how to drive yet, get your license at the License Center. ((/gps_licensecenter))");
}
}
else if(planes == 592 || planes == 577 || planes == 511 || planes == 512 || planes == 593 || planes == 520 || planes == 553 || planes == 476 || planes == 519 || planes == 460 || planes == 513) {
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_DARKRED, "*** You don't know how to fly yet, get your license at the License Center. ((/gps_licensecenter))");
}
}
else if(boats == 472 || boats == || boats == || boats == || boats == || boats == || boats == || boats == || ) {
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_DARKRED, "*** You don't know how to fly yet, get your license at the License Center. ((/gps_licensecenter))");
}
}
return 1;
}

This is my script to detect if the player has the license for the vehicle.
Now there are Bikes, Planes 'n' Boats. I don't want to write all the model again and again so
my question was if i can add something like this:

Quote:

new bike = GetVehicleModel(vehicleid);
bike()
{
1213;
1231321l
blablabla
}

So i can add:

Quote:

if(model != bike) {
SendClient lalblablalbla..
}

I hope someone will help me..

Thanks,
Greetings..
Reply
#2

Yeah, you can do it like that:
pawn Код:
new bike = all bike models goes here..;
There's no other way :S
Reply
#3

Quote:
Originally Posted by ikarus
Посмотреть сообщение
Yeah, you can do it like that:
pawn Код:
new bike = all bike models goes here..;
There's no other way :S
Thanks but how would my server now that bike is a vehicleid?
Reply
#4

pawn Код:
new bike = models;
if(GetVehicleModel(vehicleid)==bike)
{
...
Reply
#5

Quote:
Originally Posted by ikarus
Посмотреть сообщение
pawn Код:
new bike = models;
if(GetVehicleModel(vehicleid)==bike)
{
...
Thanks but i think i already solved it:

Quote:

new model;
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);
new ambulance = (416)

GetVehicleModel(model);

This is possible right
Reply
#6

pawn Код:
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);
new ambulance = (416)

if(GetPlayerVehicleID(playerid) == bikes)
{
    //If entered a bike
}

else if(GetPlayerVehicleID(playerid) == planes)
{
    //If entered a plane
}
Reply
#7

Hehe i had same question thanks hannes
im sure it works for ihsan aswell if he responds :P
havent tested it though.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)