Kick out of VEH?
#1

Say if I have:
Код:
AddStaticVehicle(416,1183.1184,-1315.7708,13.7222,178.1139,1,3); // AMBULANCE right front
How can I make it so that When you enter it kicks you out of the car and displays a message?
Reply
#2

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerVehicleID(playerid) == 416)
    {
        SendClientMessage(playerid, COLOR_RED, "Message here!");
        RemovePlayerFromVehicle(playerid);
    }
    return 1;
}
Not sure if this is correct. Anyone please correct me if I'm wrong.
Reply
#3

pawn Код:
//OnTop
new GTFO;

//Ongamemodeinit
GTFO= AddStaticVehicle(416,1183.1184,-1315.7708,13.7222,178.1139,1,3); // AMBULANCE right front

//OnPlayerEnterVehicle
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
   if(vehicleid == GTFO)
   {
    SendClientMessage(playerid, 0xFFFFFFFF, "GTFO");
    RemovePlayerFromVehicle(playerid);
   }
    return 1;
}
Reply
#4

Quote:
Originally Posted by sniperwars
Посмотреть сообщение
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerVehicleID(playerid) == 416)
    {
        SendClientMessage(playerid, COLOR_RED, "Message here!");
        RemovePlayerFromVehicle(playerid);
    }
    return 1;
}
Not sure if this is correct. Anyone please correct me if I'm wrong.
sorry for double post ,but this is wrong.
there is a difference between VehicleID and VehicleModel
Reply
#5

I didn't think about that because I'm tired. At least I tried LOL. Thanks for the good tip HuSs3n.
Reply
#6

Whats wrong? It doesnt work?
pawn Код:
//Cars with id of GTFO
GTFO= AddStaticVehicle(473,461.6448,-1885.9976,1.4758,32.5020,56,53); // Digny boat dealership
    GTFO= AddStaticVehicle(472,470.8299,-1878.3210,2.6988,353.8353,56,53); // coastguard boat dealership
    GTFO= AddStaticVehicle(446,491.6731,-1877.9454,3.1793,76.7462,1,5); // squalo boat dealeership
    GTFO= AddStaticVehicle(402,561.4337,-1290.1370,17.0799,41.6603,13,13); // buffalo GROTTI
    GTFO= AddStaticVehicle(415,555.1501,-1290.0126,17.0185,40.6865,25,1); // cheetah GROTTI
    GTFO= AddStaticVehicle(429,549.8007,-1290.4285,16.9289,37.1887,13,13); // Banshee GROTTI
    GTFO= AddStaticVehicle(475,544.2843,-1290.4539,17.0473,35.2693,9,39); // Sabre GROTTI
    GTFO= AddStaticVehicle(477,538.7817,-1289.9727,17.0001,35.3376,94,1); // ZR GROTTI
    GTFO= AddStaticVehicle(558,564.8015,-1281.4299,16.8786,91.9030,116,1); // Uranus GROTTI
    GTFO= AddStaticVehicle(559,563.1653,-1277.8361,16.8986,96.0121,58,8); // Jester GROTTI
    GTFO= AddStaticVehicle(589,561.4285,-1273.7260,16.9003,97.6116,31,31); // Club GROTTI
    GTFO= AddStaticVehicle(402,561.4044,-1269.1206,17.0739,99.9186,22,22); // Buffalo GROTTI
    GTFO= AddStaticVehicle(420,1092.7970,-1247.9038,15.6066,0.0099,6,1); // Taxi PROFESSIONS
    GTFO= AddStaticVehicle(408,1098.5225,-1247.9800,16.3772,2.3717,26,26); // Trashmaster PROFFESION
    GTFO= AddStaticVehicle(431,1091.3983,-1193.0220,18.2704,90.3025,75,59); // Bus PROFFESSION
    GTFO= AddStaticVehicle(433,1090.8722,-1199.4076,18.3366,271.9277,43,0); // 433 PROFFESSION
    GTFO= AddStaticVehicle(416,1177.0164,-1338.8049,14.0691,89.4257,1,3); // AMBULANCE left back
    GTFO= AddStaticVehicle(416,1183.8112,-1332.2963,13.7283,358.3028,1,3); // AMBULANCE left front
    GTFO= AddStaticVehicle(416,1177.0221,-1308.6152,14.0187,89.9038,1,3); // AMBULANCE right back
    GTFO= AddStaticVehicle(416,1183.1184,-1315.7708,13.7222,178.1139,1,3); // AMBULANCE right front

//top
#include <a_samp>

new GTFO;

#if defined FILTERSCRIPT

main()
{
    print("\n----------------------------------");
    print(" Los Santos RP");
    print("----------------------------------\n");
}

#endif

//OnCarEnter
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    if(vehicleid == GTFO)
     {
    SendClientMessage(playerid, 0xFFFFFFFF, "Car not for sale!");
    RemovePlayerFromVehicle(playerid);
   }
    return 1;
}
Whats up with this?
Reply
#7

I think you need to define it like this:

pawn Код:
new GTFO1;
new GTFO2;
new GTFO3;
new GTFO4;
new GTFO5;
new GTFO6;
new GTFO7;
new GTFO8;
new GTFO9;
new GTFO10;
new GTFO11;
new GTFO12;
new GTFO13;
new GTFO14;
new GTFO15;
new GTFO16;
new GTFO17;
new GTFO18;
new GTFO19;
new GTFO20;

    GTFO1= AddStaticVehicle(473,461.6448,-1885.9976,1.4758,32.5020,56,53); // Digny boat dealership
    GTFO2= AddStaticVehicle(472,470.8299,-1878.3210,2.6988,353.8353,56,53); // coastguard boat dealership
    GTFO3= AddStaticVehicle(446,491.6731,-1877.9454,3.1793,76.7462,1,5); // squalo boat dealeership
    GTFO4= AddStaticVehicle(402,561.4337,-1290.1370,17.0799,41.6603,13,13); // buffalo GROTTI
    GTFO5= AddStaticVehicle(415,555.1501,-1290.0126,17.0185,40.6865,25,1); // cheetah GROTTI
    GTFO6= AddStaticVehicle(429,549.8007,-1290.4285,16.9289,37.1887,13,13); // Banshee GROTTI
    GTFO7= AddStaticVehicle(475,544.2843,-1290.4539,17.0473,35.2693,9,39); // Sabre GROTTI
    GTFO8= AddStaticVehicle(477,538.7817,-1289.9727,17.0001,35.3376,94,1); // ZR GROTTI
    GTFO9= AddStaticVehicle(558,564.8015,-1281.4299,16.8786,91.9030,116,1); // Uranus GROTTI
    GTFO10= AddStaticVehicle(559,563.1653,-1277.8361,16.8986,96.0121,58,8); // Jester GROTTI
    GTFO11= AddStaticVehicle(589,561.4285,-1273.7260,16.9003,97.6116,31,31); // Club GROTTI
    GTFO12= AddStaticVehicle(402,561.4044,-1269.1206,17.0739,99.9186,22,22); // Buffalo GROTTI
    GTFO13= AddStaticVehicle(420,1092.7970,-1247.9038,15.6066,0.0099,6,1); // Taxi PROFESSIONS
    GTFO14= AddStaticVehicle(408,1098.5225,-1247.9800,16.3772,2.3717,26,26); // Trashmaster PROFFESION
    GTFO15= AddStaticVehicle(431,1091.3983,-1193.0220,18.2704,90.3025,75,59); // Bus PROFFESSION
    GTFO16= AddStaticVehicle(433,1090.8722,-1199.4076,18.3366,271.9277,43,0); // 433 PROFFESSION
    GTFO17= AddStaticVehicle(416,1177.0164,-1338.8049,14.0691,89.4257,1,3); // AMBULANCE left back
    GTFO18= AddStaticVehicle(416,1183.8112,-1332.2963,13.7283,358.3028,1,3); // AMBULANCE left front
    GTFO19= AddStaticVehicle(416,1177.0221,-1308.6152,14.0187,89.9038,1,3); // AMBULANCE right back
    GTFO20= AddStaticVehicle(416,1183.1184,-1315.7708,13.7222,178.1139,1,3); // AMBULANCE right front

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    if(vehicleid < 1 || > 20)
     {
    SendClientMessage(playerid, 0xFFFFFFFF, "Car not for sale!");
    RemovePlayerFromVehicle(playerid);
   }
    return 1;
}
I think this is wrong.. Correct if it's wrong
Reply
#8

Quote:

C:\Documents and Settings\zara\Desktop\samp\pawno\LSRP.pwn(154) : error 029: invalid expression, assumed zero
C:\Documents and Settings\zara\Desktop\samp\pawno\LSRP.pwn(154) : warning 215: expression has no effect
C:\Documents and Settings\zara\Desktop\samp\pawno\LSRP.pwn(154) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\zara\Desktop\samp\pawno\LSRP.pwn(154) : error 029: invalid expression, assumed zero
C:\Documents and Settings\zara\Desktop\samp\pawno\LSRP.pwn(154) : fatal error 107: too many error messages on one line

Not to sure whats going on here? Unknown fix... Only appears after the last code entered
Reply
#9

Post line 154 please.
Reply
#10

pawn Код:
if(vehicleid < 1 || > 20)
I tried some other things too.. But im not sure.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)