Üzenetek megjelenítése

Ez a szekció lehetővé teszi a felhasználó által írt összes hozzászólás megtekintését. Vedd figyelembe, hogy csak azokba a fórumokba írt hozzászólásokat látod, amelyekhez hozzáférésed van.


Témák - sGx

Oldalak: [1]
1
RP/RPG kérések / Oxfordból a kocsirendszer
« Dátum: 2012. július 08. - 22:19:39 »
Hi.
Valaki kiszedné nekem a kocsirendszert az oxford módbol?

2
Fórum Archívum (Témák/Fórumok) / tTöröld
« Dátum: 2012. július 05. - 22:16:11 »
asd

3
Segítségkérés / Gyaloglás stílus
« Dátum: 2012. július 05. - 21:07:01 »
Helló.
Csomó szerveren láttam már olyat hogy pl beírtam h /walk és akk kijött egy dialog és akk ki lehetett választani a járás stílust, ezt hogy lehet?

4
Segítségkérés / Alap futás stílus
« Dátum: 2012. július 05. - 21:05:21 »
Helló!
Valaki meg tudná mondani hogy hogy lehet átváltoztatni a játékosok futásstílusát arra ami az alap játékba van ahol a cj tud egyedül gyorsan futni?
elõre is köszi

5
Segítségkérés / Test Szerver
« Dátum: 2012. július 05. - 20:55:32 »
Helló!
Egy teljes testszervert szeretnék kérni amibe a legújjab pluginok vannak és 100% h mûködik is :D
elõre is köszi

6
Segítségkérés / Motor leállítása
« Dátum: 2012. június 26. - 14:04:34 »
Helló.
Azt szeretném megkérdezni hogy hogyan lehet leállítani a motort a kocsiba.
Konkrétan arra gondolok amikor nem is \"zúg\" a motor és nem is füstöl a kipufogó
Elõre is köszi :)

7
Segítségkérés / Dutils hiba
« Dátum: 2012. június 25. - 18:08:20 »
Hali.
Az lenne a kérdésem h miért van az hogy haveromtól kaptam egy módot amibe nincs dutils.inc és neki tökéletesen mûködik nekem meg akk is warningos ha belerakom a dutils.inc-t
Valamint a fölrakom a szerómra nem jók a parancsok. Mindre serwer unknow command
(minden inc és plugin a legfrisseb!)
[mod]Máskor témára utaló nevet adj.[/mod]

8
RP/RPG kérések / Vehetõ kocsirendszer
« Dátum: 2012. június 23. - 16:59:28 »
Helló.
Lassan 2 hónapja keresek már kocsirendszert, találtam is jópárat de egyik buggosabb volt mint a másik(általába nem mentette a tulajt)
remélem tud valaki adni nekem eggyet
lényeg:
mentse a kocsi pozidióját ha kiszállunk
mentse a tulajt
eladás megvétel
Válaszokat elõre is köszönöm!
 
Utó irat: Légyszi ne florian kocsirendszerét linkeljétek már próbáltam párszor de sehogy nem volt jó ahogy másoknak se akit kérdeztem =([/quote]

9
Segítségkérés / progressbar
« Dátum: 2012. június 23. - 12:54:54 »
Helló.
Valaki meg tudná nekem csinálni ezt a scriptet taxtdraw helyett progressbarosra?
 
//********************* [ Credits ] ******************************************//
/*
      Car Fuel Script by Cameltoe
              Version 1.3
             
I do not demand to keep the credits but it is appreciated.
*/
//******************** [ Includes ] ******************************************//
#include <a_samp>
#include <zcmd>
#include <progress>
//******************** [ Forwards ] ******************************************//
forward FuelDown(playerid);
//******************** [ Defines ] ******************************************//
// Vehicles
#undef MAX_VEHICLES
#define MAX_VEHICLES 50
// Fuel
#define REFUEL_COST 100
#define MAX_FUEL 100
#define FUEL_DECREASE 1
// Colors
#define COLOR_RED         0xFF000000
#define COLOR_YELLOW       0xFFFF0000
#define COLOR_BLUE          0x0000FF00
#define COLOR_GREEN       0x00FF0000
//******************** [ Enums ] *********************************************//
enum Car
{
Float:Fuel,
}
//******************** [ Symbols ] *******************************************//
new Carinfo[MAX_VEHICLES][Car];
new Text:FuelText[MAX_PLAYERS];
new FuelTimer[MAX_PLAYERS];
new Bar:vhealth2[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
forward ProgressBar2();
//******************** [ Callbakcs ] *****************************************//
public OnFilterScriptInit()
{
printf(\"_____________________________________\");
printf(\"|                                   |\");
printf(\"|           Fuel FS v1.1            |\");
printf(\"|               By                  |\");
printf(\"|            Cameltoe               |\");
printf(\"|___________________________________|\");
for(new vehicleid; vehicleid < MAX_VEHICLES; vehicleid++)
{
Carinfo[vehicleid][Fuel] = MAX_FUEL;
}
SetTimer(\"ProgressBar2\", 500, 1);
return 1;
}
/*main()
{
printf(\"_____________________________________\");
printf(\"|                                   |\");
printf(\"|           Fuel FS v1.1            |\");
printf(\"|               By                  |\");
printf(\"|            Cameltoe               |\");
printf(\"|___________________________________|\");
for(new vehicleid; vehicleid < MAX_VEHICLES; vehicleid++)
{
Carinfo[vehicleid][Fuel] = MAX_FUEL;
}
return 1;
}*/
public OnPlayerConnect(playerid)
{
FuelText[playerid] = TextDrawCreate(450.0, 405.0,\"         \");
TextDrawHideForPlayer(playerid,FuelText[playerid]);
TextDrawAlignment(FuelText[playerid],0);
TextDrawSetProportional(FuelText[playerid],1);
TextDrawSetShadow(FuelText[playerid], 1);
TextDrawSetOutline(FuelText[playerid], 2);
TextDrawLetterSize(FuelText[playerid],0.60,2.0);
TextDrawFont(FuelText[playerid], 3);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    TextDrawDestroy(FuelText[playerid]);
return 1;
}
 
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(oldstate == PLAYER_STATE_DRIVER)
    {
        DestroyProgressBar(vhealth2[playerid]);
        vhealth2[playerid] = INVALID_BAR_ID;
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
        vhealth2[playerid] = CreateProgressBar(144.00, 430.00, _, _, 0x0000FFFF, 1000.0);
        ShowProgressBarForPlayer(playerid, floatround(Carinfo[vehicleid][Fuel]));
    }
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
return 0;
}
//******************** [ Functions ] ********************************************//
public FuelDown(playerid)
{
new string[128];
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(floatround(Carinfo[vehicleid][Fuel]) <= 0 || Carinfo[vehicleid][Fuel] - GetPlayerSpeed(playerid) * FUEL_DECREASE / 100 < 0)
{
   format(string,sizeof(string),\"~g~ Fuel: ~w~ 0\");
   SendClientMessage(playerid, COLOR_RED, \"This vehicle has ran out of fuel\");
   KillTimer(FuelTimer[playerid]);
   ToggleVehicleEngine(vehicleid, false);
   TextDrawSetString(FuelText[playerid], string);
}
else
{
   Carinfo[vehicleid][Fuel] = Carinfo[vehicleid][Fuel] - GetPlayerSpeed(playerid) * FUEL_DECREASE / 100;
   format(string,sizeof(string),\"~g~ Fuel: ~w~ %d\", floatround(Carinfo[vehicleid][Fuel]));
   TextDrawSetString(FuelText[playerid], string);
}
}
else
{
format(string,sizeof(string),\"~g~ Fuel: ~w~ \");
KillTimer(FuelTimer[playerid]);
}
}
//******************** [ Stocks ] ********************************************//
stock ToggleVehicleEngine(vehicleid, bool: Mode)
{
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(Mode == false) SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
    else SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
}
stock GetPlayerSpeed(playerid)
{
new Float:ST[4];
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]); else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 180;
return floatround(ST[3]);
}
//******************** [ Commands ] ******************************************//
command(car, playerid, params[])
{
new Float:Pos[4]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]);
    new vehicleid = CreateVehicle(411, Pos[0], Pos[1], Pos[2], Pos[3], 0, 0, 60*10000);
    PutPlayerInVehicle(playerid, vehicleid, 0);
return 1;
}
command(money, playerid, params[])
{
GivePlayerMoney(playerid, 500);
return 1;
}
command(refuel, playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_YELLOW, \"You to be inside an vehicle to refuel it.\");
    if(GetPlayerMoney(playerid) < REFUEL_COST) return SendClientMessage(playerid, COLOR_YELLOW, \"You do not have enough money to refuel your vehicle.\");
Carinfo[GetPlayerVehicleID(playerid)][Fuel] = MAX_FUEL;
KillTimer(FuelTimer[playerid]);
ToggleVehicleEngine(GetPlayerVehicleID(playerid), true);
FuelTimer[playerid] = SetTimerEx(\"FuelDown\", 1000, true, \"i\", playerid); // Fueldown timer
GivePlayerMoney(playerid, -REFUEL_COST);
SendClientMessage(playerid, COLOR_YELLOW, \"You refueled your vehicle.\");
return 1;
}
public ProgressBar2() //I prefer not to use OnPlayerUpdate with textdraws
{
    for(new playerid; playerid < MAX_PLAYERS; playerid++) //I recommend foreach(Player, playerid)
    {
        new vehicleid;
        if((vehicleid = GetPlayerVehicleID(playerid)) && vhealth[playerid] != INVALID_BAR_ID)
        {
            new Float:health;
            GetVehicleHealth(vehicleid, health);
            SetProgressBarValue(floatround(Carinfo[vehicleid][Fuel]));
            UpdateProgressBar(floatround(Carinfo[vehicleid][Fuel]), playerid);
        }
    }
}

 
Nagyon hálás lennék érte :)

10
Szkript kérések / progressbar
« Dátum: 2012. június 23. - 09:55:10 »
Helló.
Valaki meg tudná nekem csinálni ezt a scriptet taxtdraw helyett progressbarosra?
 
//********************* [ Credits ] ******************************************//
/*
      Car Fuel Script by Cameltoe
              Version 1.3
             
I do not demand to keep the credits but it is appreciated.
*/
//******************** [ Includes ] ******************************************//
#include <a_samp>
#include <zcmd>
#include <progress>
//******************** [ Forwards ] ******************************************//
forward FuelDown(playerid);
//******************** [ Defines ] ******************************************//
// Vehicles
#undef MAX_VEHICLES
#define MAX_VEHICLES 50
// Fuel
#define REFUEL_COST 100
#define MAX_FUEL 100
#define FUEL_DECREASE 1
// Colors
#define COLOR_RED         0xFF000000
#define COLOR_YELLOW       0xFFFF0000
#define COLOR_BLUE          0x0000FF00
#define COLOR_GREEN       0x00FF0000
//******************** [ Enums ] *********************************************//
enum Car
{
Float:Fuel,
}
//******************** [ Symbols ] *******************************************//
new Carinfo[MAX_VEHICLES][Car];
new Text:FuelText[MAX_PLAYERS];
new FuelTimer[MAX_PLAYERS];
new Bar:vhealth2[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
forward ProgressBar2();
//******************** [ Callbakcs ] *****************************************//
public OnFilterScriptInit()
{
printf(\"_____________________________________\");
printf(\"|                                   |\");
printf(\"|           Fuel FS v1.1            |\");
printf(\"|               By                  |\");
printf(\"|            Cameltoe               |\");
printf(\"|___________________________________|\");
for(new vehicleid; vehicleid < MAX_VEHICLES; vehicleid++)
{
Carinfo[vehicleid][Fuel] = MAX_FUEL;
}
SetTimer(\"ProgressBar2\", 500, 1);
return 1;
}
/*main()
{
printf(\"_____________________________________\");
printf(\"|                                   |\");
printf(\"|           Fuel FS v1.1            |\");
printf(\"|               By                  |\");
printf(\"|            Cameltoe               |\");
printf(\"|___________________________________|\");
for(new vehicleid; vehicleid < MAX_VEHICLES; vehicleid++)
{
Carinfo[vehicleid][Fuel] = MAX_FUEL;
}
return 1;
}*/
public OnPlayerConnect(playerid)
{
FuelText[playerid] = TextDrawCreate(450.0, 405.0,\"         \");
TextDrawHideForPlayer(playerid,FuelText[playerid]);
TextDrawAlignment(FuelText[playerid],0);
TextDrawSetProportional(FuelText[playerid],1);
TextDrawSetShadow(FuelText[playerid], 1);
TextDrawSetOutline(FuelText[playerid], 2);
TextDrawLetterSize(FuelText[playerid],0.60,2.0);
TextDrawFont(FuelText[playerid], 3);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    TextDrawDestroy(FuelText[playerid]);
return 1;
}
 
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(oldstate == PLAYER_STATE_DRIVER)
    {
        DestroyProgressBar(vhealth2[playerid]);
        vhealth2[playerid] = INVALID_BAR_ID;
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
        vhealth2[playerid] = CreateProgressBar(144.00, 430.00, _, _, 0x0000FFFF, 1000.0);
        ShowProgressBarForPlayer(playerid, floatround(Carinfo[vehicleid][Fuel]));
    }
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
return 0;
}
//******************** [ Functions ] ********************************************//
public FuelDown(playerid)
{
new string[128];
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(floatround(Carinfo[vehicleid][Fuel]) <= 0 || Carinfo[vehicleid][Fuel] - GetPlayerSpeed(playerid) * FUEL_DECREASE / 100 < 0)
{
   format(string,sizeof(string),\"~g~ Fuel: ~w~ 0\");
   SendClientMessage(playerid, COLOR_RED, \"This vehicle has ran out of fuel\");
   KillTimer(FuelTimer[playerid]);
   ToggleVehicleEngine(vehicleid, false);
   TextDrawSetString(FuelText[playerid], string);
}
else
{
   Carinfo[vehicleid][Fuel] = Carinfo[vehicleid][Fuel] - GetPlayerSpeed(playerid) * FUEL_DECREASE / 100;
   format(string,sizeof(string),\"~g~ Fuel: ~w~ %d\", floatround(Carinfo[vehicleid][Fuel]));
   TextDrawSetString(FuelText[playerid], string);
}
}
else
{
format(string,sizeof(string),\"~g~ Fuel: ~w~ \");
KillTimer(FuelTimer[playerid]);
}
}
//******************** [ Stocks ] ********************************************//
stock ToggleVehicleEngine(vehicleid, bool: Mode)
{
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(Mode == false) SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
    else SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
}
stock GetPlayerSpeed(playerid)
{
new Float:ST[4];
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]); else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 180;
return floatround(ST[3]);
}
//******************** [ Commands ] ******************************************//
command(car, playerid, params[])
{
new Float:Pos[4]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]);
    new vehicleid = CreateVehicle(411, Pos[0], Pos[1], Pos[2], Pos[3], 0, 0, 60*10000);
    PutPlayerInVehicle(playerid, vehicleid, 0);
return 1;
}
command(money, playerid, params[])
{
GivePlayerMoney(playerid, 500);
return 1;
}
command(refuel, playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_YELLOW, \"You to be inside an vehicle to refuel it.\");
    if(GetPlayerMoney(playerid) < REFUEL_COST) return SendClientMessage(playerid, COLOR_YELLOW, \"You do not have enough money to refuel your vehicle.\");
Carinfo[GetPlayerVehicleID(playerid)][Fuel] = MAX_FUEL;
KillTimer(FuelTimer[playerid]);
ToggleVehicleEngine(GetPlayerVehicleID(playerid), true);
FuelTimer[playerid] = SetTimerEx(\"FuelDown\", 1000, true, \"i\", playerid); // Fueldown timer
GivePlayerMoney(playerid, -REFUEL_COST);
SendClientMessage(playerid, COLOR_YELLOW, \"You refueled your vehicle.\");
return 1;
}
public ProgressBar2() //I prefer not to use OnPlayerUpdate with textdraws
{
    for(new playerid; playerid < MAX_PLAYERS; playerid++) //I recommend foreach(Player, playerid)
    {
        new vehicleid;
        if((vehicleid = GetPlayerVehicleID(playerid)) && vhealth[playerid] != INVALID_BAR_ID)
        {
            new Float:health;
            GetVehicleHealth(vehicleid, health);
            SetProgressBarValue(floatround(Carinfo[vehicleid][Fuel]));
            UpdateProgressBar(floatround(Carinfo[vehicleid][Fuel]), playerid);
        }
    }
}

 
Nagyon hálás lennék érte :)

11
RP/RPG kérések / sscanf hiba szerintem vagy nem?
« Dátum: 2012. június 22. - 21:34:59 »
Helló.
Az lenne az baj hogy... van egy 0 ról írt rp módom és a parancsok egy jó részében használtam sscanf et és minden rendesen fut a házi test szerveremen... de amint fölraktam a hostos szerveremre az sscanf es parancsok nem jók viszont ha sima sscanf-et rakok a mód elejére akk meg az sscanfes parancsok jók és a többi nem.
Hogy lehet ezt megoldani?

12
RP/RPG kérések / Kocsi vásárlás
« Dátum: 2012. június 22. - 13:44:16 »
Helló!
Találtam angol fórumon egy kocsi rendszert ami mûködik is tökéletesen csak az az egy baj van vele hogy összesen 11 kocsit lehet venni.
Valaki megnézné és elmondaná hogy miért van ez?
 
    //===========================Section: Includes==================================
    #include <a_samp>
    //===========================Section: Definitions===============================
    #pragma tabsize 0
    #define COLOR_GRAD1 0xB4B5B7FF
    #define COLOR_GRAD2 0xBFC0C2FF
    #define COLOR_GRAD3 0xCBCCCEFF
    #define COLOR_GRAD4 0xD8D8D8FF
    #define COLOR_GRAD5 0xE3E3E3FF
    #define COLOR_GRAD6 0xF0F0F0FF
    #define COLOR_GREEN 0x33AA33AA
    #define COLOR_GREY 0xAFAFAFAA
    #define COLOR_WHITE 0xFFFFFFAA
    #define COLOR_YELLOW 0xFFFF00AA
    #define COLOR_YELLOW2 0xF5DEB3AA
    //===========================Section: Forwards==================================
    forward split(const strsrc[], strdest[][], delimiter);
    forward LoadCar();
    forward CheckOwner(playerid);
    forward SaveCars();
    //===========================Section: Variables=================================
    enum pInfo
    {
       pCarKey,
    }
    new PlayerInfo[256][pInfo];
    enum cInfo
    {
       cModel,
       Float:cLocationx,
       Float:cLocationy,
       Float:cLocationz,
       Float:cAngle,
       cColorOne,
       cColorTwo,
       cOwner[MAX_PLAYER_NAME],
       cDescription[MAX_PLAYER_NAME],
       cValue,
       cLicense,
       cRegistration,
       cOwned,
       cLock,
       ownedvehicle,
    };
    new CarInfo[50][cInfo];
    new CarAutolock[999]; // Variable for Autolocking Car Doors
    new cartrack[256];
    new CarOffered[256];
    //===========================Section: strtok & split============================
    strtok(const string[], &index)
    {
       new length = strlen(string);
       while ((index < length) && (string[index] <= \' \'))
       {
          index++;
       }
       new offset = index;
       new result[20];
       while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1)))
       {
          result[index - offset] = string[index];
          index++;
       }
       result[index - offset] = EOS;
       return result;
    }
    public split(const strsrc[], strdest[][], delimiter)
    {
       new i, li;
       new aNum;
       new len;
       while(i <= strlen(strsrc)){
           if(strsrc==delimiter || i==strlen(strsrc)){
               len = strmid(strdest[aNum], strsrc, li, i, 128);
               strdest[aNum][len] = 0;
               li = i+1;
               aNum++;
          }
  i++;
       }
       return 1;
    }
    //===========================Section: Callbacks & Functions=====================
    public OnFilterScriptInit()
    {
       printf(\"Filterscript [FS]CarOwnership.amx Initiated\\n\");
       LoadCar();
       for(new i = 1; i < sizeof(CarInfo); i++)
       {
          CarInfo[ownedvehicle] = CreateVehicle(CarInfo[cModel],CarInfo[cLocationx],CarInfo[cLocationy],CarInfo[cLocationz],CarInfo[cAngle],CarInfo[cColorOne],CarInfo[cColorTwo],300000);
       }
       SetTimer(\"SaveCars\",60000,1);
       SetTimer(\"CheckOwner\",5000,1);
       return 1;
    }
    public OnVehicleSpawn(vehicleid)
    {
       for(new i = 1; i < sizeof(CarInfo); i++)
       {
          ChangeVehicleColor(CarInfo[ownedvehicle],CarInfo[vehicleid][cColorOne],CarInfo[vehicleid][cColorTwo]);
       }
       return 1;
    }
    public CheckOwner(playerid)
    {
       if(IsPlayerConnected(playerid))
       {
           for(new i = 1; i < sizeof(CarInfo); i++)
           {
               new playername[MAX_PLAYER_NAME];
               GetPlayerName(playerid,playername,sizeof(playername));
               if(strcmp(playername,CarInfo[cOwner],true)==0)
               {
                   PlayerInfo[pCarKey] = i;
                return i;
               }
          }
       }
       return 1;
    }
    public OnPlayerConnect(playerid)
    {
       PlayerInfo[playerid][pCarKey] = 0;
       CheckOwner(playerid);
       return 1;
    }
    public OnPlayerCommandText(playerid, cmdtext[])
    {
       new idx;
       new string[256];
       new cmd[256];
       new tmp[256];
       new sendername[MAX_PLAYER_NAME];
       cmd = strtok(cmdtext, idx);
       new vehid = GetPlayerVehicleID(playerid);
       if(strcmp(cmd, \"/carbuy\", true) == 0)
       {
           if(IsPlayerConnected(playerid))
           {
               for(new i = 0; i < sizeof(CarInfo); i++)
               {
                if(CarInfo[ownedvehicle] == vehid)
                {
                   if(PlayerInfo[playerid][pCarKey]!=0)
                   {
                      SendClientMessage(playerid, COLOR_GREY, \"You already own a car, type /car sell if you want to buy this one!\");
                      return 1;
                   }
                   if(CarInfo[cOwned]==1)
                   {
                       SendClientMessage(playerid, COLOR_GREY, \"Someone already owns this car\");
                       return 1;
                   }
                   if(GetPlayerMoney(playerid) >= CarInfo[cValue])
                   {
                      PlayerInfo[playerid][pCarKey] = i;
                      CarInfo[cOwned] = 1;
                      CarOffered[playerid]=0;
                      GetPlayerName(playerid, sendername, sizeof(sendername));
                      strmid(CarInfo[cOwner], sendername, 0, strlen(sendername), 999);
                      GivePlayerMoney(playerid,-CarInfo[cValue]);
                      GameTextForPlayer(playerid, \"~w~Congratulations~n~This is your car until you sell it!\", 5000, 3);
                      SendClientMessage(playerid, COLOR_GRAD2, \"Congratulations on your new purchase!\");
                      SendClientMessage(playerid, COLOR_GRAD2, \"Type /car manual to view the car manual!\");
                      TogglePlayerControllable(playerid, 1);
                      SaveCars();
                      return 1;
                   }
                   else
                   {
                      SendClientMessage(playerid, COLOR_GREY, \"   You don\'t have the cash for that!\");
                      return 1;
                   }
                }
             }
          }
          return 1;
       }
       if(strcmp(cmd,\"/car\",true)==0)
       {
          new playername[MAX_PLAYER_NAME];
          GetPlayerName(playerid,playername,sizeof(playername));
           tmp = strtok(cmdtext, idx);
           if(!strlen(tmp))
           {
               SendClientMessage(playerid,COLOR_WHITE,\"(( Use /car manual for detailed instructions for: ))\");
               SendClientMessage(playerid,COLOR_WHITE,\"(( [CarOwnership by KDSTStaff ))\");
               return 1;
           }
           if(strcmp(tmp,\"exit\",true)==0)
           {
               CarOffered[playerid]=0;
               RemovePlayerFromVehicle(playerid);
               TogglePlayerControllable(playerid, 1);
               return 1;
           }
          if(strcmp(tmp, \"manual\", true) == 0)
          {
              if(IsPlayerConnected(playerid))
              {
                  if(PlayerInfo[playerid][pCarKey]!=0)
                  {
                   format(string,sizeof(string),\"________________%s________________\",CarInfo[CheckOwner(playerid)][cDescription]);
                   SendClientMessage(playerid, COLOR_GREEN,string);
                   SendClientMessage(playerid, COLOR_GRAD2,\"** /carbuy - Buys the car (if for sale)\");
                   SendClientMessage(playerid, COLOR_GRAD2,\"** /car sell - Sells the car\");
                   SendClientMessage(playerid, COLOR_GRAD2,\"** /car manual - Shows this list\");
                   SendClientMessage(playerid, COLOR_GRAD2,\"** /car exit - Exits the car\");
                   SendClientMessage(playerid, COLOR_GRAD2,\"** /car locate - Uses the car\'s On-Star to locate\");
                   SendClientMessage(playerid, COLOR_GRAD2,\"** /car lock - Locks the car\");
                   SendClientMessage(playerid, COLOR_GRAD2,\"** /car unlock - Unlocks the car\");
                   SendClientMessage(playerid, COLOR_GRAD2,\"** /car autolock - Automatically locks the car upon exiting\");
                   return 1;
                }
                else
                {
                    SendClientMessage(playerid,COLOR_GRAD2,\"** You do not currently own a car! **\");
                    return 1;
                }
             }
             return 1;
          }
          if(strcmp(tmp, \"buy\", true) == 0)
          {
              if(IsPlayerConnected(playerid))
              {
                  for(new i = 0; i < sizeof(CarInfo); i++)
                  {
                   if(CarInfo[ownedvehicle] == vehid)
                   {
                      if(PlayerInfo[playerid][pCarKey]!=0)
                      {
                         SendClientMessage(playerid, COLOR_GREY, \"You already own a car, type /carsell if you want to buy this one!\");
                         return 1;
                      }
                      if(CarInfo[cOwned]==1)
                      {
                          SendClientMessage(playerid, COLOR_GREY, \"Someone already owns this car\");
                          return 1;
                      }
                      if(GetPlayerMoney(playerid) >= CarInfo[cValue])
                      {
                         PlayerInfo[playerid][pCarKey] = i;
                         CarInfo[cOwned] = 1;
                         CarOffered[playerid]=0;
                         GetPlayerName(playerid, sendername, sizeof(sendername));
                         strmid(CarInfo[cOwner], sendername, 0, strlen(sendername), 999);
                         GivePlayerMoney(playerid,-CarInfo[cValue]);
                         GameTextForPlayer(playerid, \"~w~Congratulations~n~This is your car until you sell it!\", 5000, 3);
                         SendClientMessage(playerid, COLOR_GRAD2, \"Congratulations on your new purchase!\");
                         SendClientMessage(playerid, COLOR_GRAD2, \"Type /manual to view the car manual!\");
                         TogglePlayerControllable(playerid, 1);
                         SaveCars();
                         return 1;
                      }
                      else
                      {
                         SendClientMessage(playerid, COLOR_GREY, \"   You don\'t have the cash for that!\");
                         return 1;
                      }
                   }
                }
             }
             return 1;
          }
          if(strcmp(tmp, \"sell\", true) == 0)
          {
              if(IsPlayerConnected(playerid))
             {
                GetPlayerName(playerid, playername, sizeof(playername));
                if(PlayerInfo[playerid][pCarKey] == 0)
                {
                   SendClientMessage(playerid, COLOR_GREY, \"You don\'t own a car.\");
                   return 1;
                }
                if(PlayerInfo[playerid][pCarKey] != 0 && strcmp(playername, CarInfo[PlayerInfo[playerid][pCarKey]][cOwner], true) == 0)
                {
                   new car = PlayerInfo[playerid][pCarKey];
                   CarInfo[car][cOwned] = 0;
                   GetPlayerName(playerid, sendername, sizeof(sendername));
                   strmid(CarInfo[car][cOwner], \"Dealership\", 0, strlen(\"Dealership\"), 999);
                   GivePlayerMoney(playerid,CarInfo[car][cValue]);
                   PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                   format(string, sizeof(string), \"~w~You have sold your car for: ~n~~g~$%d\", CarInfo[car][cValue]);
                   GameTextForPlayer(playerid, string, 10000, 3);
                   RemovePlayerFromVehicle(playerid);
                   TogglePlayerControllable(playerid, 1);
                   PlayerInfo[playerid][pCarKey] = 999;
                   return 1;
                }
             }
             return 1;
          }
          if(strcmp(tmp, \"locate\", true) == 0)
          {
              if(!IsPlayerConnected(playerid)) { return 1; }
              if(PlayerInfo[playerid][pCarKey] == 0) { GameTextForPlayer(playerid, \"~w~You do not have a car to locate\", 2500, 3); return 1; }
              if(cartrack[playerid]==0)
              {
                  SendClientMessage(playerid,COLOR_WHITE,\"On-Star: This is On-Star\'s automated vehicle tracking system\");
                  SendClientMessage(playerid,COLOR_WHITE,\"On-Star: Please enter your PIN # and password now\");
                  SendClientMessage(playerid,COLOR_WHITE,\"On-Star: Your vehicle\'s location is now uploaded to your phone\");
                  SetPlayerCheckpoint(playerid,CarInfo[PlayerInfo[playerid][pCarKey]][cLocationx], CarInfo[PlayerInfo[playerid][pCarKey]][cLocationy], CarInfo[PlayerInfo[playerid][pCarKey]][cLocationz], 5.0);
                  cartrack[playerid] = 1;
                  return 1;
             }
             else
             {
                  SendClientMessage(playerid,COLOR_WHITE,\"On-Star: This is On-Star\'s automated vehicle tracking system\");
                  SendClientMessage(playerid,COLOR_WHITE,\"On-Star: The tracking on your vehicle has been canceled\");
                  DisablePlayerCheckpoint(playerid);
                  cartrack[playerid] = 0;
                  return 1;
             }
          }
          if(strcmp(tmp, \"lock\", true) == 0)
           {
             new keycar = PlayerInfo[playerid][pCarKey];
              if(IsPlayerConnected(playerid))
               {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                   SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,1);
                }
                format(string, sizeof(string), \"~w~Car~n~~r~Locked\");
                GameTextForPlayer(playerid, string, 10000, 3);
                CarInfo[keycar][cLock] = 1;
                return 1;
             }
          }
          if(strcmp(tmp, \"unlock\", true) == 0)
           {
             new keycar = PlayerInfo[playerid][pCarKey];
              if(IsPlayerConnected(playerid))
               {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                   SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,0);
                }
                format(string, sizeof(string), \"~w~Car~n~~g~Unlocked\");
                GameTextForPlayer(playerid, string, 10000, 3);
                CarInfo[keycar][cLock] = 0;
                return 1;
             }
          }
          if(strcmp(tmp, \"autolock\", true) == 0)
           {
             new keycar = PlayerInfo[playerid][pCarKey];
              if(CarAutolock[CarInfo[keycar][ownedvehicle]] == 0) { CarAutolock[CarInfo[keycar][ownedvehicle]] = 1; format(string, sizeof(string), \"~w~Car Autolock~n~~r~Engaged\"); return 1; }
              if(CarAutolock[CarInfo[keycar][ownedvehicle]] == 1) { CarAutolock[CarInfo[keycar][ownedvehicle]] = 0; format(string, sizeof(string), \"~w~Car Autolock~n~~g~Disengaged\"); return 1; }
              GameTextForPlayer(playerid, string, 10000, 3);
              return 1;
          }
       }
       return 0;
    }
    /*----------Car Save Functions----------*/
    public LoadCar()
    {
       new arrCoords[13][64];
       new strFromFile2[256];
       new File: file = fopen(\"[FS]CarOwnership.cfg\", io_read);
       if (file)
       {
          new idx = 0;
          while (idx < sizeof(CarInfo))
          {
             fread(file, strFromFile2);
             split(strFromFile2, arrCoords, \',\');
             CarInfo[idx][cModel] = strval(arrCoords[0]);
             CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
             CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
             CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
             CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
             CarInfo[idx][cColorOne] = strval(arrCoords[5]);
             CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
             strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
             strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
             CarInfo[idx][cValue] = strval(arrCoords[9]);
             CarInfo[idx][cLicense] = strval(arrCoords[10]);
             CarInfo[idx][cOwned] = strval(arrCoords[11]);
             CarInfo[idx][cLock] = strval(arrCoords[12]);
             printf(\"CarInfo: %d Owner:%s LicensePlate %s\",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);
             idx++;
          }
       }
       return 1;
    }
    public SaveCars()
    {
       new idx;
       new File: file2;
       while (idx < sizeof(CarInfo))
       {
           new coordsstring[256];
          format(coordsstring, sizeof(coordsstring), \"%d,%f,%f,%f,%f,%d,%d,%s,%s,%d,%s,%d,%d\\n\",
          CarInfo[idx][cModel],
          CarInfo[idx][cLocationx],
          CarInfo[idx][cLocationy],
          CarInfo[idx][cLocationz],
          CarInfo[idx][cAngle],
          CarInfo[idx][cColorOne],
          CarInfo[idx][cColorTwo],
          CarInfo[idx][cOwner],
          CarInfo[idx][cDescription],
          CarInfo[idx][cValue],
          CarInfo[idx][cLicense],
          CarInfo[idx][cOwned],
          CarInfo[idx][cLock]);
          if(idx == 0)
          {
             file2 = fopen(\"[FS]CarOwnership.cfg\", io_write);
          }
          else
          {
             file2 = fopen(\"[FS]CarOwnership.cfg\", io_append);
          }
          fwrite(file2, coordsstring);
          idx++;
          fclose(file2);
       }
       return 1;
    }
    /*public OnVehicleRespray(vehicleid)
    {
new color1, color2;
       for(new i = 0; i < sizeof(CarInfo); i++)
       {
           if(vehicleid == CarInfo[ownedvehicle])
           {
             CarInfo[cColorOne] = color1;
             CarInfo[cColorTwo] = color2;
             printf(\"[FS]CarOwnership report\");
             printf(\"** Car %s[%d] painted %d and %d\",CarInfo[cDescription],i,color1,color2);
          }
       }
       return 1;
    }*/
    public OnPlayerExitVehicle(playerid, vehicleid)
    {
       if(IsPlayerConnected(playerid))
       {
           for(new i = 0; i < sizeof(CarInfo); i++)
           {
              if(vehicleid == CarInfo[ownedvehicle])
              {
                 new Float:x,Float:y,Float:z;
                new Float:a;
                GetVehiclePos(vehicleid, x, y, z);
                GetVehicleZAngle(vehicleid, a);
                CarInfo[cLocationx] = x;
                CarInfo[cLocationy] = y;
                CarInfo[cLocationz] = z;
                CarInfo[cAngle] = a;
             }
             if(CarAutolock[vehicleid] == 1)
             {
                 for(new j = 0; j < MAX_PLAYERS; i++)
                {
                   if (IsPlayerConnected(j))
                   {
                      SetVehicleParamsForPlayer(vehicleid,j,0,1);
                      GameTextForPlayer(playerid,\"~w~Car~n~~r~Autolocked\",2500,3);
                      return 1;
                   }
                }
             }
          }
       }
       return 1;
    }
    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
       if(newstate==2)
       {
           for(new i = 0; i < sizeof(CarInfo); i++)
           {
              new newcar = GetPlayerVehicleID(playerid);
              new string[256];
               if(newcar == CarInfo[ownedvehicle])
             {
                 if(CarInfo[cOwned]==0)
                 {
                     TogglePlayerControllable(playerid, 0);
                     CarOffered[playerid]=1;
                     format(string,sizeof(string),\"~w~Car: %s~n~Price: ~g~%d~n~~w~/carbuy to buy this car\",CarInfo[cDescription],CarInfo[cValue]);
                   GameTextForPlayer(playerid,string,5000,5);
                 }
             }
          }
       }
       return 1;
    }
    public OnPlayerEnterCheckpoint(playerid)
    {
       if(cartrack[playerid]!=0)
       {
          SendClientMessage(playerid,COLOR_YELLOW,\"SMS: On-Star: Our sensors show that you have come within 5.0 metres of your vehicle\");
          DisablePlayerCheckpoint(playerid);
          cartrack[playerid] = 0;
       }
       return 1;
    }
/*
============================Ezek a kocsik hozzá==============================
422,2135.418701,-1128.477294,25.593200,110.959999,1,1,Dealership,Bobcat,50000,,0,0
543,2136.328613,-1132.250976,25.511566,110.258712,1,1,Dealership,Sadler,50000,,0,0
554,2135.458496,-1136.625488,25.735660,107.892265,1,1,Dealership,Yosemite,50000,,0,0
579,2135.744140,-1140.979614,25.173116,111.251762,1,1,Dealership,Huntley,50000,,0,0
400,2136.281738,-1144.528686,24.955900,109.024398,1,1,Dealership,Landstalker,50000,,0,0
500,2136.882568,-1147.977294,24.593900,104.355201,1,1,Dealership,Mesa,50000,,0,0
489,2122.037597,-1157.092285,24.256799,356.001007,1,1,Dealership,Rancher,50000,,0,0
445,2117.238281,-1156.901367,24.194599,337.440185,1,1,Dealership,Admiral,50000,,0,0
492,2117.775146,-1148.868041,24.202800,331.458801,1,1,Dealership,Greenwood,50000,,0,0
410,2117.998535,-1141.823730,24.537799,325.724914,1,1,Dealership,Manana,50000,,0,0
600,2118.116210,-1135.639526,24.913400,326.202606,1,1,Dealership,Picador,50000,,0,0
496,2118.714111,-1129.351440,25.015199,318.569488,1,1,Dealership,Blista Compact,50000,,0,0
*/

13
Szkript kérések / Kocsi vásárlás
« Dátum: 2012. június 21. - 22:42:59 »
Helló!
Egy komoly scriptet szeretnék kérni...
Egy kocsi rendszert szeretnék kérni...
Lényeg:
http://forum.sa-mp.com/showthread.php?t=310695
ilyen legyen csak mentse is le h ki a tulaj a kocsi színétés a poziciót ha kiszállunk a kocsiból valamint egy /elad parancs ami törli is a kocsit...
Nagyon Nagyon hálás lennék érte ha valaki megcsinálná

Oldalak: [1]
SimplePortal 2.3.7 © 2008-2024, SimplePortal