Hali. Bemutatok egy Vkey-t ami SpeedBoost-ot, és VehicleJump-ot tartalmaz.
Készítette: Én (BoOy)
Kód:
/*
//////////////////////////////////////////////
///////////////////////Vkey system////////////
/////////////////////////by BoOy/////////////
///////////////////////sampforum.hu/////////
/////////////////////////////////////////////
*/
#include a_samp
//SpeedBoost
new globC;
//CarJump
new glob10;
// -----------------------------------------------------------------------------
public OnFilterScriptInit()
{
print(\"\\n\");
print(\"------------------------------\");
print(\"Vkey system by BoOy [2011] \");
print(\"------------------------------\");
print(\"\\n\");
return 1;
}
//------------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, \"/vkey\", true) == 0)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,\"Vkey rendszer by {0d00ff}BoOy\",\"{127a04}SpeedBoost\\n{056cf2}CarJump\\n{ff0000}Összes Kikapcsolása\",\"Választ\",\"Mégse\");
return 1;
}
return 0;
}
//------------------------------------------------------------------------------
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==1 && response==1)
{
switch(listitem)
{
case 0:
{
globC = 1;
SendClientMessage(playerid,0x0009ffAA,\"Bekapcsoltad a SpeedBoost Módot. A Nitró(KEY_FIRE) gombal tudod aktiválni.\");
}
case 1:
{
glob10 = 1;
SendClientMessage(playerid,0x0009ffAA,\"Bekapcsoltad a CarJump módot. A H-Betûvel tudod használni.\");
}
case 3:
{
glob10 = 0;
globC = 0;
SendClientMessage(playerid,0x0009ffAA,\"Kikapcsoltad az összes módot\");
}
}
}
return 1;
}
//------------------------------------------------------------------------------
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_CROUCH)
{
if(glob10 == 1)
{
new Float:x, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
SetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z + 0.3);
}
}
if(newkeys & KEY_FIRE)
{
if(globC == 1)
{
new Float:vx,Float:vy,Float:vz;
GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.3, vy *1.3, vz * 1.3);
}
}
return 1;
}