Jump to content

BuNiCu-RP

Membru
  • Posts

    160
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by BuNiCu-RP

  1. Greseala mea nu am citit bine ce ai scris.

    #define INFERNUS 	411
    #define TIMER 		2*60 // 2 minute
      
    new PlayerVehicle[MAX_PLAYERS] = INVALID_VEHICLE_ID,
    	DestroyTimer = -1,
    	StartTimer = -1;
    
    
    public OnPlayerConnect(playerid) {
        PlayerVehicle[playerid] = INVALID_VEHICLE_ID;
        DeletePVar(playerid, "EnterVehicle");
        DeletePVar(playerid, "PlayerRentVeh");
        return 1;
    }
    
    public OnPlayerDisconnect(playerid, reason) {
        DeletePVar(playerid, "EnterVehicle");
        DeletePVar(playerid, "PlayerRentVeh");
    	return 1;
    }
    
    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
        if(PlayerVehicle[playerid] == vehicleid && !GetPVarInt(playerid, "EnterVehicle")) {
      	    SetPVarInt(playerid, "EnterVehicle", 1);
        } else if(PlayerVehicle[playerid] == vehicleid && GetPVarInt(playerid, "EnterVehicle") == 0) {
        	KillTimer(StartTimer);
        }
    	return 1;
    }
    
    public OnPlayerExitVehicle(playerid, vehicleid)
    {
        if(PlayerVehicle[playerid] == vehicleid && GetPVarInt(playerid, "EnterVehicle") == 1) {
      	    SetPVarInt(playerid, "EnterVehicle", 0);
            StartTimer = SetTimerEx("DestroyVehicle", 1000, true, "d", playerid);
        }
    	return 1;
    }
    
    forward DestroyVehicle(playerid);
    public DestroyVehicle(playerid) {
    	if(GetPVarInt(playerid, "EnterVehicle") != 1 && PlayerVehicle[playerid] != INVALID_VEHICLE_ID) {
        	DestroyTimer ++;
            if(DestroyTimer == TIMER) {
            	SendClientMessage(GetPVarInt(playerid, "PlayerRentVeh"), -1, "Vehiculul tau a fost distrus.");
            }
        }
      	return 1;
    }
    
    CMD:infernus(playerid, params[]) {
    	if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z)) {
        	new Float: pos[4], car;
        	GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
          	GetPlayerFacingAngle(playerid, pos[3]);
            car = AddStaticVehicleEx(INFERNUS, pos[0], pos[1], pos[2], pos[3], -1, -1, 30);
            PutPlayerInVehicle(playerid, car, 0);
          	SetPVarInt(playerid, "PlayerRentVeh", playerid);
        }
    	return 1;
    }

     

  2. CMD:premier(playerid, params[])
    {
        if (IsPlayerInRangeOfPoint(playerid,20.0,2820.0393,1319.7740,10.7577))
        {
             new Float:pos[4];
             GetPlayerPos(playerid, pos[0], pos[1], pos[2]); GetPlayerFacingAngle(playerid, pos[3]);
             new car = AddStaticVehicleEx (426, pos[0], pos[1], pos[2], pos[3], -1, -1, 30);
             PutPlayerInVehicle(playerid, car, 0);
        }
        return 1;
    }

    Incearca asa.

  3. Ai nevoie de streamer.

    #include <streamer>

     

    La ongamemodeinit()

    // Obiecte in VW 12
    CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, 12, 50.0); // VirtualWorld  = 12
    CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, 12, 50.0); // VirtualWorld  = 12
    CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, 12, 50.0); // VirtualWorld  = 12
    CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, 12, 50.0); // VirtualWorld  = 12
    
    La comanda sau unde vrei sa ii apara la playeri
    SetPlayerVirtualWorld(playerid, 12);
    
    Obiectele vor fii afisate doar daca player are vw 12.

     

    • Thanks 1
  4. IsValidVehicle(vehicleid) {
    	if(vehicleid < 0 || vehicleid > MAX_VEHICLES ) return 0;
    	return 1;
    }
    
    stock NearbyVehicles(playerid) {
    	new vehicleid, Float: VPos[3];
    	for(new i = 0; i < MAX_VEHICLES; i++) {
    		GetVehiclePos(i, VPos[0], VPos[1], VPos[2]);
    		if(IsValidVehicle(i)) {
    			if(!IsPlayerInAnyVehicle(playerid) && OwnedVeh(i) && IsPlayerInRangeOfPoint(playerid, 5.0, VPos[0], VPos[1], VPos[2])) {
    				vehicleid = i;
    			}
    		}
    	}
    	return vehicleid;
    }
    
    Function:UnlockedPlayerVehicles(playerid) {
    	if(NearbyVehicles(playerid) != INVALID_VEHICLE_ID) {
    		if(!IsPlayerInAnyVehicle(playerid) && IsValidVehicle(NearbyVehicles(playerid))) {
    			new engine, lights, alarm, doors, bonnet, boot, objective;
    			GetVehicleParamsEx(NearbyVehicles(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
    			SetVehicleParamsEx(NearbyVehicles(playerid), engine, lights, alarm, 0, bonnet, boot, objective);
    			return 1;
    		}
    	}
    	return 0;
    }
    
    La OnPlayerConnect
    SetTimerEx("UnlockedPlayerVehicles", 1000, true, "d", playerid);

     

  5. stock GetGunName(name) {
      	new id;
        switch(name) {
          case "Brass Knuckles": id = 1;
          case "Golf Club": id = 2;
          case "Nightstick": id = 3;
          case "Knife": id = 5;
          case "Baseball Bat": id = 6;
          case "Shovel": id = 7;
          case "AK47": id = 30;
        }
    	return id;
    }
    
    CMD:buygun(playerid, params[]) {
    	new gunname[32], ammo;
        if(sscanf(params, "s[32]d", gunname, ammo)) return SendClientMessage(playerid, -1, "/buygun <Gun Name> <Ammo>");
        GivePlayerWeapon(playerid, GetGunName(gunname), ammo);
        GivePlayerMoney(playerid, -500);
    	return 1;
    }

     

  6. 
    		if(hour == 23)
    		{
     			// Update all vehicles days = days + 1;
    			new str[256];
    			mysql_tquery(SQL, "UPDATE cars SET cars.days = days + 1, cars.insurance = insurance + 50", "", ""); // Face update +1 si insurance + 50 automat pentru toate masinile.
    		}

     

  7. CMD:resetq(playerid, params[]) {
        new sql[128];
        mysql_format(g_SQL, sql, sizeof(sql), "UPDATE accounts SET accounts.QuestID0 = 0, accounts.QuestID1 = 0");
        mysql_tquery(g_SQL, sql, "", "");
        printf("Quest resetat la toti jucatori inregistrati");
        return 1;
    }

    Ce e asa de greu? Cauti variabilele pentru quest in tabel conturi si le setezi pe o, fara a folosi "WHERE * = *;"

  8.     public static $_PAGE_URL = 'http://blumix.ro/panel/';
        public static $_FORUM_URL = 'https://blumix.ro/forum/';
        public static $_INDEX_URL = 'http://blumix.ro/panel/';
        public static $_PAGE_YT = 'www.youtube.com/'; //Link catre pagina (Canal) YT
        public static $_IP = '89.40.70.185'; // IP SERVER 
        public static $_SERVER_DNS = 'rpg.blumix.ro'; // DNS SERVER
        public static $_PORT = '7772'; 
        public static $_SITE_NAME = 'Nexus Sky';
        public static $_NAVBAR = "navbar navbar-fixed-top";  //" navbar navbar-fixed-top" = bar fixata,  "navbar navbar-default" - bara normala.
        public static $_SKIN_THEME = 'skin-2'; // Skin 1 = "skin-1" ; Skin 2 = "skin-3" ;  skin 4 = "skin-4" ;

     

  9. new Float:gRandomJailSpawns[3][5] = {
      {250, 1115.1315, 3135.8599, 4.2237, 272.2851},
      {250, 1222.0573, 3113.2234, 4.2278, 101.5168},
      {250, 1267.6554, 3156.7180, 4.2052, 84.2833}
    };
    
    incearca asa
    
    pentru a utiliza in gamemode poti folosi asa:
    
    Pentru prima linie:
    gRandomJailSpawns[0][0]; = skin
    gRandomJailSpawns[0][1]; = pos x
    gRandomJailSpawns[0][2]; = pos y
    gRandomJailSpawns[0][3]; = pos z
    gRandomJailSpawns[0][4]; = pos r
    
    Linia 2
    gRandomJailSpawns[1][0]; = skin
    gRandomJailSpawns[1][1]; = pos x
    gRandomJailSpawns[1][2]; = pos y
    gRandomJailSpawns[1][3]; = pos z
    gRandomJailSpawns[1][4]; = pos r
    
    Linia 3
    gRandomJailSpawns[2][0]; = skin
    gRandomJailSpawns[2][1]; = pos x
    gRandomJailSpawns[2][2]; = pos y
    gRandomJailSpawns[2][3]; = pos z
    gRandomJailSpawns[2][4]; = pos r

     

    • Haha 1
  10. Column not found: 1054 Unknown column 'NickPlayer' in 'where clause' (SQL: select * from `logfactions` where `NickPlayer` = TheBestKiller order by `Date` desc)

    Aici iti provoaca eroare la solicitarea NickPlayer spune ca nu este gasit in baza de date.

  11. Esti bun, lasa-te de pawno.

    MySQL - este un plugin pentru SA:MP care iti ofera posibilitatea sa folosesti SQL in gamemode-ul tau.

    De obicei este in /plugins/mysql.dll / mysql.so

     

    Daca folosesti ultima versiune de mysql o sa ai un folder: /logs/ si acolo un fisier `errors.txt` unde iti arata toate erorile din mysql care au aparut in urma executari serverului . server.exe

    • Thanks 1
    • Upvote 1
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.