21.09.2010, 09:55
(
Последний раз редактировалось Basicz; 21.09.2010 в 10:30.
)
Hello all, I'm releasing my first filterscript.
It's still in beta, I will add more cars at the next version.
If you want to try it, copy the script below:
Commands:
/Carspawner - Show the player a dialog to spawn a car.
--------------
Have fun!
Info: The filterscript has been updated to version beta 0.3
It's still in beta, I will add more cars at the next version.
If you want to try it, copy the script below:
pawn Код:
// Beta 0.2
#include <a_samp>
#define Dialog 4670
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Car Spawner Coded by Basicz - Loaded ");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
print("\n----------------------------------");
print(" Car Spawner Coded by Basicz - Unloaded ");
print("----------------------------------\n");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/Carspawner", true))
{
ShowPlayerDialog(playerid, Dialog, DIALOG_STYLE_LIST, "Car spawner", "Infernus\nTurismo\nPhoenix\nCheetah\nBanshee\nEuros\nBuffalo\nKart\nHotknife", "Spawn", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Dialog)
{
switch(listitem)
{
case 0:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
GetPlayerInterior(playerid);
pVeh = CreateVehicle(411, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 1:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(451, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 2:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(603, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 3:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(415, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 4:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(429, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 5:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(587, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 6:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(402, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 7:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(571, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 8:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(434, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
}
}
return 1;
}
pawn Код:
// Beta 0.3
#include <a_samp>
#define Dialog 4670
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Car Spawner Coded by Basicz - Loaded ");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
print("\n----------------------------------");
print(" Car Spawner Coded by Basicz - Unloaded ");
print("----------------------------------\n");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/Carspawner", true))
{
ShowPlayerDialog(playerid, Dialog, DIALOG_STYLE_LIST, "Car spawner", "Infernus\nTurismo\nPhoenix\nCheetah\nBanshee\nEuros\nBuffalo\nKart\nHotknife\nHustler\nComet\nStallion\nSunrise\nSandking", "Spawn", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Dialog)
{
switch(listitem)
{
case 0:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
GetPlayerInterior(playerid);
pVeh = CreateVehicle(411, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 1:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(451, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 2:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(603, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 3:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(415, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 4:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(429, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 5:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(587, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 6:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(402, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 7:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(571, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 8:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(434, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 9:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(545, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 10:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(480, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 11:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(439, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 12:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(550, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
case 13:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pVeh = CreateVehicle(495, X, Y, Z, Ang, 0, 0, -1);
LinkVehicleToInterior(pVeh, Int);
PutPlayerInVehicle(playerid, pVeh, 0);
}
}
}
return 1;
}
/Carspawner - Show the player a dialog to spawn a car.
--------------
Have fun!
Info: The filterscript has been updated to version beta 0.3