SA-MP Forums Archive
Team car - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Team car (/showthread.php?tid=509200)



Team car - Gducuing - 25.04.2014

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.


Re: Team car - Abagail - 25.04.2014

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


Re : Team car - Gducuing - 25.04.2014

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


Re : Team car - Gducuing - 26.04.2014

I don't understand the probleme ...:/


Re: Re : Team car - KayJ - 26.04.2014

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


Re: Team car - BroZeus - 26.04.2014

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


Re : Team car - Gducuing - 26.04.2014

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


Re: Re : Team car - NovaGaming - 26.04.2014

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");