08.03.2012, 13:04
[ame]http://www.youtube.com/watch?v=MhK827FcMI8&feature=channel_video_title[/ame]
At 0:15 how i can make this dialog style??
At 0:15 how i can make this dialog style??
new bool:usando[MAX_PLAYERS];
new menu:JCars;
//OnGameModeInit
JCars = CreateMenu("Carros",1,200.0,120.0,130.0);
AddMenuItem(JCars,0,"Sultan");
AddMenuItem(JCars,0,"Elegy");
AddMenuItem(JCars,0,"NRG-500");
AddMenuItem(JCars,0,"Infernus");
AddMenuItem(JCars,0,"Uranus");
AddMenuItem(JCars,0,"Jester");
AddMenuItem(JCars,0,"Super-GT");
//OnPlayerCommandText
if(strcmp(cmd,"/carros",true)==0)
{
if(usando[playerid] == false)
{
TogglePlayerControllable(playerid,0);
ShowMenuForPlayer(CARROS,playerid);
new Jeff[30];
GetPlayerName(playerid,Jeff,sizeof(Jeff));
format(string,sizeof(string),"(INFO) Player %s(%d) has open the dialog cars[/carros]",Jeff,playerid);
SendClientMessageToAll(-1,string);
return 1;
}
else
{
SendClientMessage(playerid,-1,"You're already in a car.");
}
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:JMenu = GetPlayerMenu(playerid);
if(JMenu == CARROS)
{
switch(row)
{
case 0:
{
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
SetPVarInt(playerid,"CARRO",CreateVehicle(560,X,Y,Z,Angle,-1,-1,600000));
PutPlayerInVehicle(playerid,GetPVarInt(playerid,"CARRO"),0);
new string[50];
format(string,sizeof(string),"Vehicle On");
SendClientMessage(playerid,-1,string);
TogglePlayerControllable(playerid,1);
usando[playerid] = true;
return 1;
}
case 1:
{
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
SetPVarInt(playerid,"CARRO",CreateVehicle(562,X,Y,Z,Angle,-1,-1,600000));
PutPlayerInVehicle(playerid,GetPVarInt(playerid,"CARRO"),0);
SendClientMessage(playerid,-1,"Vehicle On");
TogglePlayerControllable(playerid,1);
usando[playerid] = true;
return 1;
}
case 2:
{
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
SetPVarInt(playerid,"CARRO",CreateVehicle(522,X,Y,Z,Angle,-1,-1,600000));
PutPlayerInVehicle(playerid,GetPVarInt(playerid,"CARRO"),0);
SendClientMessage(playerid,-1,"Vehicle On");
TogglePlayerControllable(playerid,1);
usando[playerid] = true;
return 1;
}
case 3:
{
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
SetPVarInt(playerid,"CARRO",CreateVehicle(411,X,Y,Z,Angle,-1,-1,600000));
PutPlayerInVehicle(playerid,GetPVarInt(playerid,"CARRO"),0);
SendClientMessage(playerid,-1,"Vehicle On");
TogglePlayerControllable(playerid,1);
usando[playerid] = true;
return 1;
}
case 4:
{
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
SetPVarInt(playerid,"CARRO",CreateVehicle(558,X,Y,Z,Angle,-1,-1,600000));
PutPlayerInVehicle(playerid,GetPVarInt(playerid,"CARRO"),0);
SendClientMessage(playerid,-1,"Vehicle On");
TogglePlayerControllable(playerid,1);
usando[playerid] = true;
return 1;
}
case 5:
{
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
SetPVarInt(playerid,"CARRO",CreateVehicle(559,X,Y,Z,Angle,-1,-1,600000));
PutPlayerInVehicle(playerid,GetPVarInt(playerid,"CARRO"),0);
SendClientMessage(playerid,-1,"Vehicle On");
TogglePlayerControllable(playerid,1);
usando[playerid] = true;
return 1;
}
case 6:
{
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
SetPVarInt(playerid,"CARRO",CreateVehicle(506,X,Y,Z,Angle,-1,-1,600000));
PutPlayerInVehicle(playerid,GetPVarInt(playerid,"CARRO"),0);
SendClientMessage(playerid,-1,"Vehicle On");
TogglePlayerControllable(playerid,1);
usando[playerid] = true;
return 1;
}
}
}
return 1;
}
public OnPlayerExitedMenu(playerid)
{
TogglePlayerControllable(playerid,1);
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(vehicleid == GetPVarInt(playerid,"CARRO"))
{
new carro = GetPlayerVehicleID(playerid);
DestroyVehicle(carro);
new string[80];
format(string,sizeof(string),"Vehicle destroyed");
SendClientMessage(playerid,-1,string);
usando[playerid] = false;
return 1;
}
return 1;
}