12.07.2011, 08:50
Should work:
PHP код:
#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;
}