What's wrong?! - 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: What's wrong?! (
/showthread.php?tid=360969)
What's wrong?! -
Qur - 19.07.2012
pawn Код:
forward IsATaxi(carid);
public IsATaxi(carid)
{
if(carid >= 1 && carid <= 8)
{
return 1;
}
return 0;
}
[b] on the next part the first thing - the /engine is working and shown when player enter a vehicle but the second part isnt working.. if i'm not a taxi driver and i enter i can drive, and if i'm a taxi driver who's not on duty i still can drive..
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine != 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"To start the engine use '/engine' ");
}
return 1;
}
new newcar = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(IsATaxi(newcar))
{
if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
if(OnDuty[playerid]==0)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_GREY,"You are not on duty!");
}
else if(OnDuty[playerid]==1)
{
SendClientMessage(playerid,COLOR_GREEN,"Use /help for more information");
}
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_GREY,"You are not a Taxi Driver!");
}
}
}
return 1;
}
Re: What's wrong?! -
ViniBorn - 19.07.2012
Why you dont use the model of taxi ?
Re: What's wrong?! -
Qur - 19.07.2012
Well didnt think of it.. but that's not the point..
can you tell me what's wrong in it?
in edition that I made on another script it worked perfectly..