taxi driver command
#1

Why isnt it working
pawn Code:
// Under state change :P
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT) // Player left vehicle
    {
        if(gTeam[playerid] == TAXIDRIVER)
        {
        //
            GameTextForPlayer(playerid, "~g~Taxi Duty ~r~ Ended.", 5000, 5);
            SendClientMessageToAll(COLOR_RED,"Has quit his taxi-job, lazy welfare immigrant.");
            gTeam[playerid] = CIVILIAN;
        }
    }

// the command, duh
CMD:taxiduty(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"You have to be inside a vehicle.");
    if(g_PlayerInfo[playerid][pJailed] == 1) return SendClientMessage(playerid, red, "You cannot use this command in jail.");
    if(GetPlayerWantedLevel(playerid) >= 1) return SendClientMessage(playerid, red, "ERROR: You can't start taxiduty when you are wanted.");
    if(gTeam[playerid] == POLICE && FIREMEN && MEDIC && ARMY) return SendClientMessage(playerid, red, "Cops can't do robberies!");
    if(gTeam[playerid] == TAXIDRIVER) return SendClientMessage(playerid, red, "You are already a taxidriver!");
    new vehicle = GetPlayerVehicleID(playerid);
    if(vehicle > 431 && 438 && 437 && 420)
    {
        if(gTeam[playerid] == CIVILIAN)
        {
            GameTextForPlayer(playerid, "~g~Taxi Duty ~w~ Started", 5000, 5);
            SendClientMessage(playerid,COLOR_GREEN,"You are now a taxi driver, /taxifare to adjust your fare-cost.");
            SendClientMessageToAll(COLOR_GREEN,"Is now on duty as a Taxi Driver and charges: 100$/10min.");
            gTeam[playerid] = TAXIDRIVER;
        }
        else
        {
            GameTextForPlayer(playerid, "~g~Taxi Duty ~r~ Ended.", 5000, 5);
            SendClientMessageToAll(COLOR_RED,"Has quit his taxi-job, lazy welfare immigrant.");
            gTeam[playerid] = CIVILIAN;
        }
    }
    return 1;
}
Reply
#2

This
pawn Code:
if(vehicle > 431 && 438 && 437 && 420)
is not a valid statement. You'll have to do
pawn Code:
if(x > y && x > z && x > a)
or a switch-statement equivalent.

However, I think you want to check if the player enters a cab? In that case you have to use equation, not difference:
pawn Code:
if( vehicle == 431 || vehicle == 438 || vehicle == 437 || vehicle == 420 )
//if vehicle is 431, 438, 437 OR 420 - any of those will work
Reply
#3

Quote:
Originally Posted by LarzI
View Post
This
pawn Code:
if(vehicle > 431 && 438 && 437 && 420)
is not a valid statement. You'll have to do
pawn Code:
if(x > y && x > z && x > a)
or a switch-statement equivalent.

However, I think you want to check if the player enters a cab? In that case you have to use equation, not difference:
pawn Code:
if( vehicle == 431 || vehicle == 438 || vehicle == 437 || vehicle == 420 )
//if vehicle is 431, 438, 437 OR 420 - any of those will work
thanks

edit : still doesnt work... hmm =/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)