Car Windows System
#1

hey all so i saw in alot of servers (RolePlay) Windows on cars but i tryed to find it and fail so if any guy haves any archive with this or link plz say here... it wold be nice!

thanks for see...
Reply
#2

Because cars on other servers don't have windows.
Reply
#3

yes they have its one windows system do when you talk and your inside the car and if the windows are rolled up i cant hear you outside...
Reply
#4

As best as I can tell, you are looking for a role play script that says: "Your windows are rolled up! Type /rolldownwindows first!"



Because rolling windows aren't synched.
Reply
#5

Quote:
Originally Posted by Damon_Black
As best as I can tell, you are looking for a role play script that says: "Your windows are rolled up! Type /rolldownwindows first!"



Because rolling windows aren't synched.
What the hell are you talking about?
Reply
#6

What he meant is that the command is only declared by a variable.

Example:
pawn Код:
//global
new
    gWindowsUp;
pawn Код:
//OnPlayerCommandText
if(! strcmp( cmdtext, "/rolldownwindows", true ))
{
    if( gWindowsUp == 0 )
        return SendClientMessage( playerid, 0xFF0000FF, "[ERROR]Windows already rolled down" );
    gWindowsUp = 0;
    SendClientMessage( playerid, 0x00FF00FF, "[SUCCESS]Windows rolled down" );
    return true;
}
pawn Код:
if(! strcmp( cmdtext, "/rollupwindows", true ))
{
    if( gWindowsUp == 1 )
        return SendClientMessage( playerid, 0xFF0000FF, "[ERROR]Windows already rolled up" );
    gWindowsUp = 1;
    SendClientMessage( playerid, 0x00FF00FF, "[SUCCESS]Windows rolled up" );
    return true;
}
Then if you want to check if windows is rolled down, just do
pawn Код:
if( gWindowsUp == 0 )
Reply
#7

Quote:
Originally Posted by mavtias
What the hell are you talking about?
Unless this guy has some window rolling function he'd like to share with us.
Reply
#8

Doh, just copy It from the LARP script..
Reply
#9

Here:

pawn Код:
//---[On top of your script]---//

new VehicleWindows[MAX_VEHICLES] = 0;

OnPlayerText(playerid, text);
{
  if(IsPlayerInAnyVehicle(playerid))
  {
    if(VehicleWindows[playerid] == 0)
    {
       SendClientMessage(playerid, COLOR, "[Windows Up]: %s", text);
    }
    else if(VehicleWindows[playerid] == 1)
    {
       SendClientMessage(playerid, COLOR, "[Windows Down]: %s", text);
    }
  }
  return 1;
}

//---[Then, the /windows command:]---//

if(!strcmp(cmdtext, "/windows", true) || !strcmp(cmdtext, "/wi", true))
    {
      if(IsPlayerConnected(playerid))
      {
        if(IsPlayerInAnyVehicle(playerid))
        {
                {
                  SendClientMessage(playerid, COLOR_GREY, " This vehicle doesn't have the window to roll");
                  return 1;
                }
          if(VehicleWindows[GetPlayerVehicleID(playerid)] == 0)
          {
            VehicleWindows[GetPlayerVehicleID(playerid)] = 1;
            GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "* %s rolls down the window.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                return 1;
                }
                else if(VehicleWindows[GetPlayerVehicleID(playerid)] == 1)
                {
                  VehicleWindows[GetPlayerVehicleID(playerid)] = 0;
            GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "* %s rolls up the window.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                return 1;
                }
                return 1;
        }
        else
        {
          SendClientMessage(playerid, COLOR_GREY, "  You need to be in the vehicle to use this function !");
          return 1;
        }
      }
      return 1;
    }
Make sure you have the prox detector function.
Reply
#10

well i already did it but i have a problem here is the cmd
pawn Код:
if(strcmp(cmd, "/windows", true) == 0)
    {
    new strh[256];
    new player[MAX_PLAYER_NAME];
    new vehicleid = GetPlayerVehicleID(playerid);
    GetPlayerName(playerid, player, sizeof(player));
    if(IsPlayerInAnyVehicle(playerid))
    if(WindowsR[playerid] == 1)
    {
    WindowsR[playerid] = 0;
    SendClientMessage(playerid,0x0089FFC6,"[Vehicle]: You rolled your vehicle windows down");
    format(strh, sizeof(strh), "** %s: rolled down the windows of the vehicle %s **", player, GetVehicleName(vehicleid));
    ProxDetector(15.0, playerid, strh, COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK);
    return 1;
    }
    else
    {
    WindowsR[playerid] = 1;
    SendClientMessage(playerid,0x0089FFC6,"[Vehicle]: You rolled your vehicle windows up");
    format(strh, sizeof(strh), "** %s: rolled up the windows of the vehicle %s **", player, GetVehicleName(vehicleid));
    ProxDetector(15.0, playerid, strh, COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK);
    return 1;
    }
    return 1;
    }
and mine on playertext
pawn Код:
if(WindowsR[playerid] == 1)
    {
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
    if( !IsPlayerInAnyVehicle( playerid ) && i != playerid && !IsPlayerInAnyVehicle( i ))
    return true;
    else if( !IsPlayerInAnyVehicle( playerid ) && i != playerid && IsPlayerInAnyVehicle( i ))
    return false;
    }}
but my problem now its if your outise the car and you talk i can hear with the windows rolled up but if i talk with the windows rolled up you cant hear so i want if the windows are rolled up i cant hear nothing what your talking outside the car (im inside the car dont forgot)...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)