Hellosztok!
Találtam itt a fórumon 2 db scriptet!
De én ebbe a scriptbe azt szeretném megcsinálni mindkettõbe hogy parancs nélkül müködjenek vagyis ha felépsz a szerverre és kocsiba vagy akkor nem kell semmit beírni hanem csak nyomod a CTRL-t és jönn elõ rámpa és a driftelésnél is ne kelljen parancsot beírni hanem a driftelsz magától számolja!!
PLS HELP!
Scriptek:
Rámpa:
[pawn]////////////////////////////////////////////
////////Ramping system By [icE_aGe]/////////
////////////////////////////////////////////
#include <a_samp>
#define RAMP 1632
#define tavolsag 15.0
#define ido 5000
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, &Float:z, &Float:a)
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (tavolsag * floatsin(-a, degrees));
y += (tavolsag * floatcos(-a, degrees));
}
new tempkey, ramp;
new Float: X, Float: Y, Float: Z, Float: A;
forward Delete(objectid);
new beirta[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
beirta[playerid]=0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, \"/ramp on\", true))
{
SendClientMessage(playerid, 0xFFFFFFFF, \"Mostantol a CTRL-töl elötted megjelenik egy szöktetõ\");
beirta[playerid]=1;
return 1;
}
if(!strcmp(cmdtext, \"/ramp off\", true))
{
SendClientMessage(playerid, 0xFFFFFFFF, \"Mostantol nem jelenik meg a szöktetõ\");
beirta[playerid]=0;
return 1;
}
return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
tempkey = newkeys - oldkeys;
if(tempkey == KEY_ACTION)
{
if (IsPlayerInAnyVehicle(playerid))
{
if (beirta[playerid] == 1)
{
GetXYInFrontOfPlayer(playerid, X, Y, Z, A);
ramp = CreateObject(RAMP, X, Y, Z, 0.0, 0.0, A);
SetTimerEx(\"Delete\", ido, 0, \"d\", ramp);
}
}
}
return 1;
}
public Delete(objectid)
{
DestroyObject(objectid);
return 1;
}[/pawn]
Drift mérõ:
[pawn]#include a_samp
#define DRIFT_MINKAT 10.0
#define DRIFT_MAXKAT 90.0
#define COLOR_LIGHTRED 0xFF0000FF
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define DRIFT_SPEED 30.0
#pragma tabsize 0
#pragma unused GetPlayerTheoreticAngle
new Float:ppos[200][3];
enum Float:Pos{ Float:sX,Float:sY,Float:sZ };
new Float:SavedPos[MAX_PLAYERS][Pos];
new DriftPointsNow[200];
new PunktyDriftuGracza[200];
new Text:DriftTD[200];
forward LicznikDriftu();
forward clock();
forward PodsumowanieDriftu(playerid);
public OnFilterScriptInit(){
for(new x=0;x<200;x++){
DriftTD
- = TextDrawCreate(42.000000, 304.000000, \" \");
TextDrawBackgroundColor(DriftTD
TextDrawFont(DriftTD
TextDrawLetterSize(DriftTD
TextDrawColor(DriftTD
TextDrawSetOutline(DriftTD
TextDrawSetProportional(DriftTD
TextDrawSetShadow(DriftTD
}
SetTimer(\"AngleUpdate\" , 700, true);
SetTimer(\"LicznikDriftu\", 500, true);
return 1;
}
IsCar(vid)
{
new model = GetVehicleModel(vid);
switch(model)
{
case 443:return 0;
case 448:return 0;
case 461:return 0;
case 462:return 0;
case 463:return 0;
case 468:return 0;
case 521:return 0;
case 522:return 0;
case 523:return 0;
case 581:return 0;
case 586:return 0;
case 481:return 0;
case 509:return 0;
case 510:return 0;
case 430:return 0;
case 446:return 0;
case 452:return 0;
case 453:return 0;
case 454:return 0;
case 472:return 0;
case 473:return 0;
case 484:return 0;
case 493:return 0;
case 595:return 0;
case 417:return 0;
case 425:return 0;
case 447:return 0;
case 465:return 0;
case 469:return 0;
case 487:return 0;
case 488:return 0;
case 497:return 0;
case 501:return 0;
case 548:return 0;
case 563:return 0;
case 406:return 0;
case 444:return 0;
case 556:return 0;
case 557:return 0;
case 573:return 0;
case 460:return 0;
case 464:return 0;
case 476:return 0;
case 511:return 0;
case 512:return 0;
case 513:return 0;
case 519:return 0;
case 520:return 0;
case 539:return 0;
case 553:return 0;
case 577:return 0;
case 592:return 0;
case 593:return 0;
case 471:return 0;
}
return 1;
}
forward AngleUpdate();
public AngleUpdate(){
for(new g=0;g<200;g++){
new Float:x, Float:y, Float:z;
if(IsPlayerInAnyVehicle(g))GetVehiclePos(GetPlayerVehicleID(g), x, y, z); else GetPlayerPos(g, x, y, z);
ppos[g][0] = x;
ppos[g][1] = y;
ppos[g][2] = z;
}
}
Float:GetPlayerTheoreticAngle(i)
{
new Float:sin;
new Float:dis;
new Float:angle2;
new Float:x,Float:y,Float:z;
new Float:tmp3;
new Float:tmp4;
new Float:MindAngle;
if(IsPlayerConnected(i)){
GetPlayerPos(i,x,y,z);
dis = floatsqroot(floatpower(floatabs(floatsub(x,ppos
- )),2)+floatpower(floatabs(floatsub(y,ppos
[1])),2));
if(IsPlayerInAnyVehicle(i))GetVehicleZAngle(GetPlayerVehicleID(i), angle2); else GetPlayerFacingAngle(i, angle2);
if(x>ppos;}else{tmp3=ppos-x;}
if(y>ppos[1]){tmp4=y-ppos[1];}else{tmp4=ppos[1]-y;}
if(ppos[1]>y && ppos
sin = asin(tmp3/dis);
MindAngle = floatsub(floatsub(floatadd(sin, 90), floatmul(sin, 2)), -90.0);
}
if(ppos[1]<y && ppos
sin = asin(tmp3/dis);
MindAngle = floatsub(floatadd(sin, 180), 180.0);
}
if(ppos[1]<y && ppos
sin = acos(tmp4/dis);
MindAngle = floatsub(floatadd(sin, 360), floatmul(sin, 2));
}
if(ppos[1]>y && ppos
sin = asin(tmp3/dis);
MindAngle = floatadd(sin, 180);
}
}
if(MindAngle == 0.0){
return angle2;
} else
return MindAngle;
}
public PodsumowanieDriftu(playerid){
PunktyDriftuGracza[playerid] = 0;
GivePlayerMoney(playerid,DriftPointsNow[playerid]);
DriftPointsNow[playerid] = 0;
TextDrawSetString(DriftTD[playerid],\" \");
}
Float:ReturnPlayerAngle(playerid){
new Float:Ang;
if(IsPlayerInAnyVehicle(playerid))GetVehicleZAngle(GetPlayerVehicleID(playerid), Ang); else GetPlayerFacingAngle(playerid, Ang);
return Ang;
}
public LicznikDriftu(){
new Float:Angle1, Float:Angle2, Float:BySpeed, s[256];
new Float:Z;
new Float:X;
new Float:Y;
new Float:SpeedX;
for(new g=0;g<200;g++){
GetPlayerPos(g, X, Y, Z);
SpeedX = floatsqroot(floatadd(floatadd(floatpower(floatabs(floatsub(X,SavedPos[ g ][ sX ])),2),floatpower(floatabs(floatsub(Y,SavedPos[ g ][ sY ])),2)),floatpower(floatabs(floatsub(Z,SavedPos[ g ][ sZ ])),2)));
Angle1 = ReturnPlayerAngle(g);
Angle2 = GetPlayerTheoreticAngle(g);
BySpeed = floatmul(SpeedX, 12);
if(GetPlayerState(g) == PLAYER_STATE_DRIVER && IsCar(GetPlayerVehicleID(g)) && floatabs(floatsub(Angle1, Angle2)) > DRIFT_MINKAT && floatabs(floatsub(Angle1, Angle2)) < DRIFT_MAXKAT && BySpeed > DRIFT_SPEED){
if(PunktyDriftuGracza[g] > 0)KillTimer(PunktyDriftuGracza[g]);
PunktyDriftuGracza[g] = 0;
DriftPointsNow[g] += floatval( floatabs(floatsub(Angle1, Angle2)) * 3 * (BySpeed*0.1) )/10;
PunktyDriftuGracza[g] = SetTimerEx(\"PodsumowanieDriftu\", 3000, 0, \"d\", g);
}
if(DriftPointsNow[g] > 0){
format(s, sizeof(s), \"Driftp¾nz~w~: %d$\", DriftPointsNow[g]);
TextDrawSetString(DriftTD[g], s);
}
SavedPos[ g ][ sX ] = X;
SavedPos[ g ][ sY ] = Y;
SavedPos[ g ][ sZ ] = Z;
}
}
//Split(s1[], s2[], s3[]=\"\"){new rxx[256];format(rxx, 256, \"%s%s%s\", s1, s2, s3);return rxx;}
//tostr(int){new st[256];format(st, 256, \"%d\", int);return st;}
floatval(Float:val){new str[256];format(str, 256, \"%.0f\", val);return todec(str);}
todec(str[]){return strval(str);}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER){
TextDrawShowForPlayer(playerid, DriftTD[playerid]);
}
return 1;
}
public OnPlayerConnect(playerid)
{
new x;
TextDrawHideForPlayer(playerid, DriftTD
SendClientMessage(playerid,COLOR_LIGHTBLUE,\"Ha Driftelsz pénzt tudsz keresni!\");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new x;
if (strcmp(\"/driftoff\", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,\"Drift Mérö kikapcsolva !!\");
TextDrawHideForPlayer(playerid, DriftTD
return 1;
}
if (strcmp(\"/drifton\", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,\"Dift mérö Bekapcsolva! Ha driftelsz pénzt kapsz érte!\");
TextDrawShowForPlayer(playerid, DriftTD
return 1;
}
return 0;
}[/pawn]
És még ha valaki ezt a kettõt nekem egybe is tudná rakni azt nagyon megköszönném nagyon remélem hogy tudtok segíteni!