Need forbidden vehicles script
#1

I need a script to ban some vehicles!
id: 520
548
425
432
464

I searched the forum, I found but I do not go to me.

expect a functional script.

thanks
Reply
#2

What do you mean by ban? Why not just not spawn them? :P
Reply
#3

Don't add those vehicles in ur script.

OR Do this:
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerVehicleID(playerid) == 520
    {
        RemovePlayerFromVehicle(playerid);
    }
    return 1;
}//then do this for all the rest
Reply
#4

@Faisal_khan 5 vehicle. (520 548 425 432 464)

pawn Код:
C:\Users\sas\ALL 2\pawno ultimate\include\sscanf.inc(3) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\sas\Desktop\rza.pwn(564) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\sas\Desktop\rza.pwn(774) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\sas\Desktop\rza.pwn(823) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\sas\Desktop\rza.pwn(1150) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\sas\Desktop\rza.pwn(1270) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\sas\Desktop\rza.pwn(4219) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\sas\Desktop\rza.pwn(5241) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\sas\Desktop\rza.pwn(5430) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\sas\Desktop\rza.pwn(10318) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\sas\Desktop\rza.pwn(10676) : error 029: invalid expression, assumed zero
C:\Users\sas\Desktop\rza.pwn(10682) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10684) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10686) : error 054: unmatched closing brace ("}")
C:\Users\sas\Desktop\rza.pwn(10687) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10692) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10694) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10696) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10698) : error 054: unmatched closing brace ("}")
C:\Users\sas\Desktop\rza.pwn(10699) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10704) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10706) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10708) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10710) : error 054: unmatched closing brace ("}")
C:\Users\sas\Desktop\rza.pwn(10711) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10716) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10718) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10720) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10722) : error 054: unmatched closing brace ("}")
C:\Users\sas\Desktop\rza.pwn(10723) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10728) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10730) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10732) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10734) : error 054: unmatched closing brace ("}")
C:\Users\sas\Desktop\rza.pwn(10735) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(10740) : error 010: invalid function or declaration

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
Reply
#5

Add this under your OnPlayerUpdate
pawn Код:
if ( IsPlayerInAnyVehicle ( playerid ) && GetPlayerVehicleID(playerid) == 520 || 548 || 425 || 432 || 464  )
    {
        RemovePlayerFromVehicle(playerid);
    }
Reply
#6

No need to use OnPlayerUpdate, OnPlayerStateChange will do.
Reply
#7

@Ronaldo_raul™ 1 error:
pawn Код:
C:\Users\sas\Desktop\rza.pwn(10985) : error 010: invalid function or declaration
@admantis - kick me in all cars / planes!

ideas?
Reply
#8

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate) {
    switch(GetVehicleModel(GetPlayerVehicleID(playerid))) {
        case 520,548,425,432,464: {
            RemovePlayerFromVehicle(playerid);
        }
    }
    return true;
}
Reply
#9

Quote:
Originally Posted by Cpt.Shady
Посмотреть сообщение
@Ronaldo_raul™ 1 error:
pawn Код:
C:\Users\sas\Desktop\rza.pwn(10985) : error 010: invalid function or declaration
@admantis - kick me in all cars / planes!

ideas?
It compiled for me perfectly. D:

Can you show me your whole OnPlayerUpdate or OnPlayerStateChange ?
Reply
#10

@Ronaldo_raul™ - OnPlayerUpdate

@zbt - 9 errors

pawn Код:
C:\Users\sas\Desktop\rza.pwn(12198) : warning 209: function "OnPlayerStateChange" should return a value
C:\Users\sas\Desktop\rza.pwn(12199) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(12202) : error 054: unmatched closing brace ("}")
C:\Users\sas\Desktop\rza.pwn(12204) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(12210) : error 054: unmatched closing brace ("}")
C:\Users\sas\Desktop\rza.pwn(12211) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(12215) : error 054: unmatched closing brace ("}")
C:\Users\sas\Desktop\rza.pwn(12216) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(12220) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(12224) : error 010: invalid function or declaration
C:\Users\sas\Desktop\rza.pwn(14533) : warning 203: symbol is never used: "pvehicleid"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


9 Errors.
OMG!!! HARD?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)