Vehicle Windows
#3

Write it like this:

PHP код:
new bool:window[MAX_VEHICLES char];
public 
OnPlayerText(playeridtext[])
{
    new 
GetPlayerVehicleID(playerid);
    if(
&& !IsABike(v)) //So only if he is in a vehicle and its not a bike
    
{
        
format(stringsizeof(string), "%s says %s: %s"sendername, (!window{v})?("[Windows Shut]"):("[Windows Down]"),text);
        
ProxDetector(20.0playeridstringCOLOR_FADE1COLOR_FADE2COLOR_FADE3COLOR_FADE4COLOR_FADE5);
        return 
0;
    }
    return 
1;
}
//if you dont have it:
#define SCM SendClientMessage
//and in the window command:
new GetPlayerVehicleID(playerid);
if(!
v) return SCM(playerid,-1,"You are not in a vehicle!");
if(
IsABike(v)) return SCM(palyerid,-1,"A bike has no windows!");
window{v} = !window{v};
GameTextForPlayer(playerid,(!window{v})?("~r~Window closed"):("~g~Window opened"),5000,5);
return 
1;
//Then at the end of the script
stock IsABike(vid)
{
    new 
GetVehicleModel(vid);
    return (
== 509||==510||==581||==522||==521||==523||==586||==481||==462||==448||==461||==463||==468||==471);

Greekz
Reply


Messages In This Thread
Vehicle Windows - by lwilson - 19.03.2015, 09:33
Re: Vehicle Windows - by CalvinC - 19.03.2015, 09:41
AW: Vehicle Windows - by Kaliber - 19.03.2015, 09:42
Re: Vehicle Windows - by lwilson - 19.03.2015, 09:59
AW: Re: Vehicle Windows - by Kaliber - 19.03.2015, 10:02

Forum Jump:


Users browsing this thread: 3 Guest(s)