30.05.2011, 21:34
Olha pessoal, eu fiz meu prуprio comando carros, mais quando vou spawnar ele nгo spawna, aqui o cуdigo e me fala o que eu errei:
Ou vocк pode baixar e me passar por pm
pawn Код:
#include <a_samp>
#define FILTERSCRIPT
#define DIALOGID 5000
main()
{
print("-----------------------");
print("-------Filter Script----");
print("------Spawn de Carros--");
print("--------By: RaRi-----");
print("-----------------------");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/Carros", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, DIALOGID+5, DIALOG_STYLE_LIST, ".:: DrF - Carros ::.", "~>Elegy\n~>Sultan\n~>Jester\n~>Police [LS]\n~>Police [LV]\n~>Police [SF]\n~>Nrg500\n~>Blade\n~>Bullet\n~>Stretch\n~>Infernus\n~>Tropic\n~>Police Maverick\n~>Shamal\n~>S.W.A.T.\n~>Monster A\n~>Monster B", "Spawnar", "sair");
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOGID) // Carros
{
if(response)
{
if(listitem == 0)//Elegy
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO]Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(562, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 1)//Sultan
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(560, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 2)//Jester
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(559, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 3)//Police LS
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(596, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 4)//Police LV
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(598, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 5)//Police SF
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(597, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 6)//Nrg 500
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, "Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(522, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 7)//Blade
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(536, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 8)//Bullet
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(541, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 9)//Stretch
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(409, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 10)//Infernus
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(411, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 11)//Tropic
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(454, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 12)//Police Maverick
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(497, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 13)//Shamal
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(519, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 14)//S.W.A.T.
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(601, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 15)//Monster A
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(556, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
if(listitem == 16)//Monster B
{
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
}
new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
GetPlayerPos(playerid, pos0, pos1, pos2);
GetPlayerFacingAngle(playerid, pos3);
CreateVehicle(557, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
}
}
else{
if(response == 2)
{
return 1;
}
}
}
return 1;
}