How to make this? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to make this? (
/showthread.php?tid=498202)
How to make this? -
Lajko1 - 02.03.2014
How can I make if player is in car with closed windows ( I have /windows command for that) he won't see any msg from ppl that are outside of car? I'm using prox detector but I guess prox detector can be seen by everyone..
Re: How to make this? -
Bashur - 02.03.2014
I think that's kinda impossible, but i'm not a pro
Re: How to make this? -
Avi Raj - 02.03.2014
You can just get like if the windows are closed, then clear chat for player after some interval of time and if it isn't, then it will be default.
Re: How to make this? -
Clad - 02.03.2014
It's very simple, Use radius and define if windows closed or not, It is already in some RP Servers
Re: How to make this? -
Lajko1 - 02.03.2014
I was thinking about using loop, player's state = ON FOOT, and if player is near player that is writing then he will get message something like this so ony players ON FOOT will get that message then I need to detect vehicles without roof and bikes and so on.. so those players will receive message also, but I need to get some help from more experienced scripters if it's possible and if I'm even thinking in right way ^^
Re: How to make this? -
Lajko1 - 02.03.2014
Quote:
Originally Posted by Clad
It's very simple, Use radius and define if windows closed or not, It is already in some RP Servers
|
pawn Код:
enum Car
{
Float:F, // Fuel - don't mind this right now...
VehWin, // Windows
}
pawn Код:
if(!strcmp(cmdtext, "/windows", true) || !strcmp(cmdtext, "/wi", true))
{
new string[128];
new playercar = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, Name, sizeof(Name));
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1,"{FF6A22}INFO: {FFFFFF}You need to be a driver to use this command.");
if(IsModelAPlane(playercar) || IsModelABike(playercar) || IsModelAHeli(playercar) || IsModelABoat(playercar) || IsModelASpecial(playercar))
{
SendClientMessage(playerid, -1, "{FF6A22}INFO: {FFFFFF}This vehicle doesn't have the window to roll.");
return 1;
}
if(Carinfo[vehicleid][VehWin] == 0) // if windows are closed we will open them
{
Carinfo[vehicleid][VehWin] = 1;
format(string, sizeof(string), "* %s rolls down the window.", Name);
ProxDetector(30.0, playerid, string, COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE);
return 1;
}
else if(Carinfo[vehicleid][VehWin] == 1) // if windows are open we will close them
{
Carinfo[vehicleid][VehWin] = 0;
format(string, sizeof(string), "* %s rolls up the window.", Name);
ProxDetector(30.0, playerid, string, COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "{FF6A22}INFO: {FFFFFF}You need to be in the vehicle to use this function!");
return 1;
}
return 1;
}
This is what I'm currently using but idk how to combine all this in OnPlayerText .. I will need some help hah :P thanks for answers also
Re: How to make this? -
Clad - 02.03.2014
Use vehicle models for detect bikes or cars, It won't take you much time
Re: How to make this? -
Clad - 02.03.2014
Код:
if(Carinfo[vehicleid][VehWin] == 0)
from this you can make it receive message or not.