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. |
//global
new
gWindowsUp;
//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;
}
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;
}
if( gWindowsUp == 0 )
Originally Posted by mavtias
What the hell are you talking about?
|
//---[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;
}
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;
}
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;
}}