What's wrong?
#1

pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
       new classid;
       if(classid == 106)
       {
          new vehicleid=GetPlayerVehicleID(playerid);
          GetVehicleModel(vehicleid);
          if(GetVehicleModel(vehicleid) == 596)
          {
             SetPlayerWantedLevel(playerid,4);
             SendClientMessageToAll(RED,"%s has stolen a polcie car");
             SetPlayerColor(playerid,RED);
          }
       }
     }

    return 1;
}
I think the classid is the problem anyway help pelase
Reply
#2

Do you use gTeam?
Reply
#3

hmmm

Code:
new vehicleid=GetPlayerVehicleID(playerid);
          GetVehicleModel(vehicleid);
in translation GetVehicleModel(vehicleid) = vehicleid = GetPlayerVehicleID
Reply
#4

well no i don't use yet but im thinking about using it
Reply
#5

Ok it's best to use it if you want to make Cops n Robbers, roleplay etc..

pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
       new classid;
       if(classid == 106)
       {
            if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 416)
            {
                SetPlayerWantedLevel(playerid,4);
                SendClientMessageToAll(RED,"%s has stolen a polcie car");
                SetPlayerColor(playerid,RED);
            }
        }
    }
    return 1;
}
Reply
#6

top of the script :
pawn Code:
new gClassid[MAX_PLAYERS];
under OnPlayerRequestClass :
pawn Code:
gClassid[playerid] = classid;
then use :
pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
       if(gClassid[playerid] == 106)
       {
            if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 416)
            {
                SetPlayerWantedLevel(playerid,4);
                SendClientMessageToAll(RED,"%s has stolen a police car");
                SetPlayerColor(playerid,RED);
            }
        }
    }
    return 1;
}
P.S : But u better use SetPlayerTeam or gTeam instead of class ids
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)