30.05.2011, 22:27
Se quiser fazer o download do FS pronto ta aqui: By: Eu
Pawno e AMX:
http://www.4shared.com/file/67NAX0Cd/Carro.html
http://www.4shared.com/file/L2mfaEhx/Carro.html
No topo do GM:
OnPlayerCommandText:
OnDialogResponse:
Espero ter ajudado.
Pawno e AMX:
http://www.4shared.com/file/67NAX0Cd/Carro.html
http://www.4shared.com/file/L2mfaEhx/Carro.html
No topo do GM:
pawn Код:
new CarrosPs[MAX_PLAYERS];
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/carros", true) == 0)
{
ShowPlayerDialog(playerid,158,DIALOG_STYLE_LIST,"Pegar carros","\n~>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");
return 1;
}
return 0;
}
OnDialogResponse:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 158)
{
if(response)
{
if(listitem == 0)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(562,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
}
if(listitem == 1)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(560,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
}
if(listitem == 2)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(559,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 3)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(596,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 4)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(598,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 5)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(597,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 6)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(522,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 7)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 536,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 8)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 409,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 9)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 541,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 10)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 411,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 11)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 554,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 12)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 497,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 13)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 519,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 14)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 601,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 15)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 556,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 16)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 557,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
return 1;
}
Espero ter ajudado.