Team car
#1

Hi ,

I have respected a tuto and i've made this for a Team car script :

Quote:

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == Cars[Police1]||CarCheck == Cars[Police2]||CarCheck == Cars[Police3]||CarCheck == Cars[Police4]||CarCheck == Cars[Police5]||CarCheck == Cars[Police6]||CarCheck == Cars[Police7]||CarCheck == Cars[Police8]||CarCheck == Cars[Police9]||CarCheck == Cars[Police0] )
{
if(gTeam[playerid] != 2)
{
SendClientMessage(playerid, COLOR_RED, "You do not have the keys for this car!");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(CarCheck == Cars[Army1]||CarCheck == Cars[Army2]||CarCheck == Cars[Army3]||CarCheck == Cars[Army4]||Cars[Army5]||CarCheck == Cars[Army6]||CarCheck == Cars[Army7]||CarCheck == Cars[Army8])
{
if(gTeam[playerid] != 4)
{
SendClientMessage(playerid, COLOR_RED, "You do not have the keys for this car!");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(CarCheck == Cars[Mafia1]||CarCheck == Cars[Mafia2]||CarCheck == Cars[Mafia3]||CarCheck == Cars[Mafia4]||CarCheck == Cars[Mafia5]||CarCheck == Cars[Mafia6]||CarCheck == Cars[Mafia7]||CarCheck == Cars[Mafia8]||CarCheck == Cars[Mafia9])
{
if(gTeam[playerid] != 1)
{
SendClientMessage(playerid, COLOR_RED, "You do not have the keys for this car!");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(CarCheck == Cars[Gang1]||CarCheck == Cars[Gang2]||CarCheck == Cars[Gang3]||CarCheck == Cars[Gang4]||CarCheck == Cars[Gang5]||CarCheck == Cars[Gang6]||CarCheck == Cars[Gang7])
{

if(gTeam[playerid] != 3)
{
SendClientMessage(playerid, COLOR_RED, "You do not have the keys for this car!");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
return 1;
}
return 1;

I don't know why but if i try to go in vehicle i'm removed for ALL vehicles...

Could you help me plz ?I think the problem come from {}

Guillaume.
Reply
#2

What do you mean by removed? Your totally confusing me with that. Like what was "removed"?
Reply
#3

I mean the command "RemovePlayerfromvehicle" is always active...i can't drive any cars..
Reply
#4

I don't understand the probleme ...:/
Reply
#5

Quote:
Originally Posted by Gducuing
Посмотреть сообщение
I mean the command "RemovePlayerfromvehicle" is always active...i can't drive any cars..
Quote:
Originally Posted by Gducuing
Посмотреть сообщение
I don't understand the probleme ...:/
He is saying that All team members are kick from car and his team member also
Reply
#6

add like this in if statements print("While checking gteam 1 executed"); print("While checking gteam 2 executed");
and so on under if statement with gteam name which u are checking
so by the above method we will come to know which i the falty if statement
try get in car and show server log after this
Reply
#7

I started pawn 3 weeks ago and i'm sorry, i don't understand what do you mean ..?
Reply
#8

Quote:
Originally Posted by Gducuing
Посмотреть сообщение
I started pawn 3 weeks ago and i'm sorry, i don't understand what do you mean ..?
It seems more like 1 day ago
If you dont have an idea what printing is
print("I check if i am printed");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)