[PROBLEM] Engine messange -
monster010 - 27.05.2014
I put that scrip at OnPlayerStateChange, and when a get in the car which is reserved:
pawn Код:
if(IsAmayorCar(newcar))
{
if(PlayerInfo[playerid][pLeader] == 7 || PlayerInfo[playerid][pMember] == 7) { }
else {
SendClientMessage(playerid,COLOR_GREY,"* You are not a {66FF00}Parliamentary {808080}member !");
RemovePlayerFromVehicle(playerid);
}
}
That script above does not work, but if I delete the script (which is the cause), the gamemode works perfectly:
pawn Код:
if (newstate == PLAYER_STATE_DRIVER)
{
if(Engine[vehicle] == 0)
{
SendClientMessage(playerid,COLOR_GREY,"* Press {FFCC00}'2'{FFFFFF} to start engine.");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GREY, "Engine is {66FF00}running...");
}
}
Re: [PROBLEM] Engine messange -
Parallex - 27.05.2014
Can you describe what is not working more? Also, are you getting any errors/warnings?
Re: [PROBLEM] Engine messange -
monster010 - 27.05.2014
When I put:
pawn Код:
if (newstate == PLAYER_STATE_DRIVER)
{
if(Engine[vehicle] == 0)
{
SendClientMessage(playerid,COLOR_GREY,"* Press {FFCC00}'2'{FFFFFF} to start engine.");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GREY, "Engine is {66FF00}running...");
}
}
Ruin OnPlayerStateChange.
Re: [PROBLEM] Engine messange -
Threshold - 27.05.2014
Get rid of the 'return 1;'.
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
SendClientMessage(playerid, COLOR_GREY, (Engine[vehicle]) ? ("Engine is {66FF00}running...") : ("* Press {FFCC00}'2'{FFFFFF} to start engine."));
Re: [PROBLEM] Engine messange -
Lacamora - 27.05.2014
Quote:
Originally Posted by BenzoAMG
Get rid of the 'return 1;'.
pawn Код:
if(newstate == PLAYER_STATE_DRIVER) SendClientMessage(playerid, COLOR_GREY, (Engine[vehicle]) ? ("Engine is {66FF00}running...") : ("* Press {FFCC00}'2'{FFFFFF} to start engine."));
|
explain us more please
what's the diffirance
Re: [PROBLEM] Engine messange -
Threshold - 27.05.2014
The difference is that the code is shorter and can be combined into 1 line if preferred, and the code won't stop because there is no 'return' breaking the callback at any point in that code.
Re: [PROBLEM] Engine messange -
Rittik - 27.05.2014
Код:
if(IsAmayorCar(newcar))
{
if(PlayerInfo[playerid][pLeader] != 7 || PlayerInfo[playerid][pMember] != 7)
{
SendClientMessage(playerid,COLOR_GREY,"* You are not a {66FF00}Parliamentary {808080}member !");
RemovePlayerFromVehicle(playerid);
}
}
Re: [PROBLEM] Engine messange -
Threshold - 27.05.2014
Oh I forgot about that bit.
pawn Код:
if(IsAmayorCar(newcar))
{
if(PlayerInfo[playerid][pLeader] != 7 && PlayerInfo[playerid][pMember] != 7)
{
SendClientMessage(playerid, COLOR_GREY, "* You are not a {66FF00}Parliamentary {808080}member !");
RemovePlayerFromVehicle(playerid);
}
}
Nearly had it Rittick.
Re: [PROBLEM] Engine messange -
monster010 - 27.05.2014
Quote:
Originally Posted by BenzoAMG
Get rid of the 'return 1;'.
pawn Код:
if(newstate == PLAYER_STATE_DRIVER) SendClientMessage(playerid, COLOR_GREY, (Engine[vehicle]) ? ("Engine is {66FF00}running...") : ("* Press {FFCC00}'2'{FFFFFF} to start engine."));
|
SOLVED. Thank's!