Originally Posted by shaikh007
#define FILTERSCRIPT
#define COLOR_RED 0xAA3333AA #include <a_samp> new Summair; new Summair1; public OnFilterScriptInit() { Summair = AddStaticVehicle(562,-1959.1219,288.1400,35.1337,89.6646,145,145); Summair1 = AddStaticVehicle(411,-1986.5643, 248.8863, 34.9182, 0, 0, 0); AddVehicleComponent(Summair, 1036); AddVehicleComponent(Summair, 1040); AddVehicleComponent(Summair, 1034); AddVehicleComponent(Summair, 1172); AddVehicleComponent(Summair, 1149); AddVehicleComponent(Summair, 1035); AddVehicleComponent(Summair, 1002); AddVehicleComponent(Summair, 1079); return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { new PlayerName[24]; GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); if(newstate == PLAYER_STATE_DRIVER) { new Vehicle = GetPlayerVehicleID(playerid); if(Vehicle == Summair) { if(strcmp(PlayerName,"Summair",true)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, 0xAA3333AA, "This car is reserved for: Summair"); } } if(Vehicle == Summair1) { if(strcmp(PlayerName,"Summair",true)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, 0xAA3333AA, "This car is reserved for: Summair"); } } } return 1; } public OnVehicleSpawn(vehicleid) { AddVehicleComponent(Summair, 1036); AddVehicleComponent(Summair, 1040); AddVehicleComponent(Summair, 1034); AddVehicleComponent(Summair, 1172); AddVehicleComponent(Summair, 1149); AddVehicleComponent(Summair, 1035); AddVehicleComponent(Summair, 1002); AddVehicleComponent(Summair, 1079); } |
Like on your command vehicle spawns at your position and you are in it?
|
#define FILTERSCRIPT
#include <a_samp>
#define COLOR_RED 0xAA3333AA
new Summair1;
new Summair2;
new pName[MAX_PLAYER_NAME];
new pName1[MAX_PLAYER_NAME];
new Float:x, Float:y, Float:z;
public OnFilterScriptInit()
{
Summair1 = AddStaticVehicle(562,-1959.1219,288.1400,35.1337,89.6646,145,145);
Summair2 = AddStaticVehicle(411,-1986.5643, 248.8863, 34.9182, 0, 0, 0);
AddVehicleComponent(Summair1, 1036);
AddVehicleComponent(Summair1, 1040);
AddVehicleComponent(Summair1, 1034);
AddVehicleComponent(Summair1, 1172);
AddVehicleComponent(Summair1, 1149);
AddVehicleComponent(Summair1, 1035);
AddVehicleComponent(Summair1, 1002);
AddVehicleComponent(Summair1, 1079);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
GetPlayerName(playerid,pName,sizeof(pName));
if (strcmp("/callpriveh", cmdtext, true, 10) == 0)
{
if(strcmp("Summair",pName,true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid))
{
GetPlayerPos(playerid,x,y,z);
SetVehiclePos(Summair1,x,y,z);
PutPlayerInVehicle(playerid,Summair1,0);
return 0;
}
return 1;
}
return 1;
}
if(strcmp("/callsecveh",cmdtext,true,10) == 0)
{
if(strcmp(pName,"Summair",true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid))
{
GetPlayerPos(playerid,x,y,z);
SetVehiclePos(Summair2,x,y,z);
PutPlayerInVehicle(playerid,Summair2,0);
return 0;
}
else SendClientMessage(playerid,COLOR_RED,"ERROR: You must exit the vehicle before using this command!");
return 1;
}
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
GetPlayerName(playerid,pName1,sizeof(pName1));
new vehid = GetVehicleModel(vehicleid);
if(vehid == Summair1)
{
if(strcmp("Summair",pName1,true) == 1)
{
SetVehicleParamsForPlayer(vehicleid,playerid,0,1);
SendClientMessage(playerid,COLOR_RED,"ERROR: This vehicle belongs to Summair!");
return 1;
}
}
if(vehid == Summair2)
{
if(strcmp("Summair",pName1,true) == 1)
{
SetVehicleParamsForPlayer(vehicleid,playerid,0,1);
SendClientMessage(playerid,COLOR_RED,"ERROR: This vehicle belongs to Summair!");
return 1;
}
}
return 1;
}
if(strcmp([command here],cmdtext,true,10) == 0)
{
if(strcmp(pName,[Player name here]),true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid))
{
GetPlayerPos(playerid,x,y,z);
SetVehiclePos([vehicle assigned variable],x,y,z);
PutPlayerInVehicle(playerid,[vehicle assigned variable],0);
return 0;
}
else SendClientMessage(playerid,COLOR_RED,"ERROR: You must exit the vehicle before using this command!");
return 1;
}
return 1;
}
if(vehid == [vehicle assigned variable])
{
if(strcmp([Player name here],pName1,true) == 1)
{
SetVehicleParamsForPlayer(vehicleid,playerid,0,1);
SendClientMessage(playerid,COLOR_RED,"ERROR: This vehicle belongs to [Player name here]!");
return 1;
}
}