Szerző Téma: Vip rendszer  (Megtekintve 2363 alkalommal)

Vip rendszer
« Dátum: 2014. április 25. - 21:59:28 »
0 Show voters
Sziasztok!
Pár nappal ezelõtt készítettem egy VIP rendszert remélem tetszeni fog. Annyi a hibája hogy ha Vipet adok vkinek akkor csak akkor adja meg neki mikor újra feljön. És ahanyas szintet állítok be y playernek olyan lesz az én szintem is. Ez a két hibája van.
VIP 1-es szintû parancsok:
/varmour /vcar /vcolor /vfix /vheal
/vjetpack /vlockcar /vgoto
/vsetmytime /vsetmyweather /vunlockcar
VIP 2-es szintû parancsok:
/vann /varmour /varmourall /vcar /vcolor /vfix /vget /vgoto /vheal
/vhealall /vhide /vjetpack /vkick /vlockcar /vrac /vsetallwanted
/vsetarmour /vsethealth /vsetmytime /vsetmyweather /vunhide /vunlockcar
RCON parancsai:
/vszint
Letöltés: http://www.mediafire.com/view/m95jrz33uwcxwzc/VIP_System.zip
CODE
 

/*
                  VIP System by: _[G]M[K]_Sh1ft_
*/
#include <a_samp>
#include <dini>
#include <dudb>
#include <zcmd>
#include <sscanf2>
#include <fixchars>
#pragma tabsize 0
#pragma unused ret_memcpy
#define red 0xFF0000AA
#define green 0x00ff09AA
#define COLOR_GREEN 0x33AA33AA
#define blue 0x375FFFFF
//-------VIP System-------//
new nev[MAX_PLAYER_NAME];
new vipszint[MAX_PLAYERS];
//---Jármû respawn cuccok---//
new vehicletimer, vehtimer;
new vehicletime;
//---Jármû lehívó cuccok---//
new SpawnedVehicles[MAX_PLAYERS];
new VehicleNames[212][] = {
{\"Landstalker\"},{\"Bravura\"},{\"Buffalo\"},{\"Linerunner\"},{\"Perrenial\"},{\"Sentinel\"},{\"Dumper\"},{\"Firetruck\"},{\"Trashmaster\"},{\"Stretch\"},{\"Manana\"},{\"Infernus\"},{\"Voodoo\"},{\"Pony\"},{\"Mule\"},
{\"Cheetah\"},{\"Ambulance\"},{\"Leviathan\"},{\"Moonbeam\"},{\"Esperanto\"},{\"Taxi\"},{\"Washington\"},{\"Bobcat\"},{\"Mr Whoopee\"},{\"BF Injection\"},{\"Hunter\"},{\"Premier\"},{\"Enforcer\"},{\"Securicar\"},
{\"Banshee\"},{\"Predator\"},{\"Bus\"},{\"Rhino\"},{\"Barracks\"},{\"Hotknife\"},{\"Trailer 1\"},{\"Previon\"},{\"Coach\"},{\"Cabbie\"},{\"Stallion\"},{\"Rumpo\"},{\"RC Bandit\"},{\"Romero\"},{\"Packer\"},{\"Monster\"},
{\"Admiral\"},{\"Squalo\"},{\"Seasparrow\"},{\"Pizzaboy\"},{\"Tram\"},{\"Trailer 2\"},{\"Turismo\"},{\"Speeder\"},{\"Reefer\"},{\"Tropic\"},{\"Flatbed\"},{\"Yankee\"},{\"Caddy\"},{\"Solair\"},{\"Berkley\'s RC Van\"},
{\"Skimmer\"},{\"PCJ-600\"},{\"Faggio\"},{\"Freeway\"},{\"RC Baron\"},{\"RC Raider\"},{\"Glendale\"},{\"Oceanic\"},{\"Sanchez\"},{\"Sparrow\"},{\"Patriot\"},{\"Quad\"},{\"Coastguard\"},{\"Dinghy\"},{\"Hermes\"},{\"Sabre\"},
{\"Rustler\"},{\"ZR-350\"},{\"Walton\"},{\"Regina\"},{\"Comet\"},{\"BMX\"},{\"Burrito\"},{\"Camper\"},{\"Marquis\"},{\"Baggage\"},{\"Dozer\"},{\"Maverick\"},{\"News Chopper\"},{\"Rancher\"},{\"FBI Rancher\"},{\"Virgo\"},{\"Greenwood\"},
{\"Jetmax\"},{\"Hotring\"},{\"Sandking\"},{\"Blista Compact\"},{\"Police Maverick\"},{\"Boxville\"},{\"Benson\"},{\"Mesa\"},{\"RC Goblin\"},{\"Hotring Racer A\"},{\"Hotring Racer B\"},{\"Bloodring Banger\"},{\"Rancher\"},
{\"Super GT\"},{\"Elegant\"},{\"Journey\"},{\"Bike\"},{\"Mountain Bike\"},{\"Beagle\"},{\"Cropdust\"},{\"Stunt\"},{\"Tanker\"}, {\"Roadtrain\"},{\"Nebula\"},{\"Majestic\"},{\"Buccaneer\"},{\"Shamal\"},{\"Hydra\"},{\"FCR-900\"},
{\"NRG-500\"},{\"HPV1000\"},{\"Cement Truck\"},{\"Tow Truck\"},{\"Fortune\"},{\"Cadrona\"},{\"FBI Truck\"},{\"Willard\"},{\"Forklift\"},{\"Tractor\"},{\"Combine\"},{\"Feltzer\"},{\"Remington\"},{\"Slamvan\"},
{\"Blade\"},{\"Freight\"},{\"Streak\"},{\"Vortex\"},{\"Vincent\"},{\"Bullet\"},{\"Clover\"},{\"Sadler\"},{\"Firetruck LA\"},{\"Hustler\"},{\"Intruder\"},{\"Primo\"},{\"Cargobob\"},{\"Tampa\"},{\"Sunrise\"},{\"Merit\"},{\"Utility\"},{\"Nevada\"},{\"Yosemite\"},{\"Windsor\"},{\"Monster A\"},{\"Monster B\"},{\"Uranus\"},{\"Jester\"},
{\"Sultan\"},{\"Stratum\"},{\"Elegy\"},{\"Raindance\"},{\"RC Tiger\"},{\"Flash\"},{\"Tahoma\"},{\"Savanna\"},{\"Bandito\"},{\"Freight Flat\"},{\"Streak Carriage\"},{\"Kart\"},{\"Mower\"},{\"Duneride\"},{\"Sweeper\"},
{\"Broadway\"},{\"Tornado\"},{\"AT-400\"},{\"DFT-30\"},{\"Huntley\"},{\"Stafford\"},{\"BF-400\"},{\"Newsvan\"},{\"Tug\"},{\"Trailer 3\"},{\"Emperor\"},{\"Wayfarer\"},{\"Euros\"},{\"Hotdog\"},{\"Club\"},{\"Freight Carriage\"},
{\"Trailer 3\"},{\"Andromada\"},{\"Dodo\"},{\"RC Cam\"},{\"Launch\"},{\"Police Car (LSPD)\"},{\"Police Car (SFPD)\"},{\"Police Car (LVPD)\"},{\"Police Ranger\"},{\"Picador\"},{\"S.W.A.T. Van\"},{\"Alpha\"},{\"Phoenix\"},{\"Glendale\"},
{\"Sadler\"},{\"Luggage Trailer A\"},{\"Luggage Trailer B\"},{\"Stair Trailer\"},{\"Boxville\"},{\"Farm Plow\"},{\"Utility Trailer\"}
};
//---Lockcar cuccok---//
new PlayerCar[MAX_PLAYERS], LockedCar[1000];
new Text:Locked;
new MsgLocked[MAX_PLAYERS], LockedTimer[MAX_PLAYERS];
forward RemoveLock(playerid);
//---Jármû respawn cuccok---//
forward VehicleRespawn();
forward CheckTimer();
public OnPlayerDisconnect(playerid, reason)
{
vipszint[playerid]= 0;
}
public OnPlayerConnect(playerid)
{
    new file[128];
GetPlayerName(playerid,nev,sizeof(nev));
format(file,sizeof(file),\"/Karakterek/%s.ini\",nev);
    vipszint[playerid] = dini_Int(file,\"vipszint\");
    PlayerCar[playerid] = -1;
return 1;
}
 
public OnPlayerText( playerid, text[ ] )
{
new textstr[ 128 ];
if ( text[ 0 ] == \'!\' && vipszint[playerid] >= 1 )
{
GetPlayerName( playerid, textstr, sizeof( textstr ) );
format( textstr, sizeof( textstr ),\"VIP-Chat: {00FF00}%s:{FF5500} %s\", textstr, text[ 1 ] );
SendVipMessage( red, textstr );
return 0;
}
return 1;
}
CMD:vszint(playerid,params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new id,szint;
        new neve[MAX_PLAYER_NAME];
        if(sscanf(params,\"ui\",id,szint))return SendClientMessage(playerid,-1,\"Használat: /vszint [Player ID] [szint]\");
        if(szint < 0 || szint > 2) return SendClientMessage(playerid,-1,\"A szintnek 0 és 2 között kell lennie!\");
        vipszint[playerid] = szint;
      new file[128];
      GetPlayerName(id,neve,sizeof(neve));
      format(file,sizeof(file),\"/Karakterek/%s.ini\",neve);
      dini_Create(file);
      dini_IntSet(file,\"vipszint\",vipszint[playerid]);
              GetPlayerName(playerid,nev,sizeof(nev));
              GetPlayerName(id,neve,sizeof(neve));
              new string[128];
              format(string,sizeof(string),\"%s megváltoztatta a vipszintedet erre: %d\",nev,szint);
              SendClientMessage(id,-1,string);
              format(string,sizeof(string),\"Megváltoztattad %s vipszintjét erre: %d\",neve,szint);
              SendClientMessage(playerid,-1,string);
              printf(\"%s megváltoztatta %s vipszintjét erre: %d\",nev,neve,szint);
    }
    else SendClientMessage(playerid,-1,\"Nem vagy rcon admin!\");
return 1;
}
CMD:vcmds(playerid, params[])
{
    if(vipszint[playerid] == 1) //11 parancs
    {
SendClientMessage(playerid, red, \"--------------------Parancsok--------------------\");
    SendClientMessage(playerid, green, \"/varmour /vcar /vcolor /vfix /vheal\");
    SendClientMessage(playerid, green, \"/vjetpack /vlockcar /vgoto\");
    SendClientMessage(playerid, green, \"/vsetmytime /vsetmyweather /vunlockcar\");
    SendClientMessage(playerid, red, \"------------------------------------------------------\");
    SendClientMessage(playerid, red, \"VIP chat: {00ff09}!(szöveg)\");
    return 1;
    }
else
{
if(vipszint[playerid] == 2) //22 parancs
    {
SendClientMessage(playerid, red, \"-----------------------------------------------Parancsok----------------------------------------------\");
       SendClientMessage(playerid, green, \"/vann /varmour /varmourall /vcar /vcolor /vfix /vget /vgoto /vheal\");
       SendClientMessage(playerid, green, \"/vhealall /vhide /vjetpack /vkick /vlockcar /vrac /vsetallwanted\");
    SendClientMessage(playerid, green, \"/vsetarmour /vsethealth /vsetmytime /vsetmyweather /vunhide /vunlockcar\");
         SendClientMessage(playerid, red, \"-----------------------------------------------------------------------------------------------------------\");
       SendClientMessage(playerid, red, \"VIP chat: {00ff09}!(szöveg)\");
         }
           else
           {
           SendClientMessage(playerid, red, \"HIBA: Nem vagy VIP tag!\");
           }
           }
return 1;
}
//----------------------------------------------------------------------------//
//--------------------------------VIP Parancsok-------------------------------//
//---------------------------VIP 1. szintû parancsok--------------------------//
//----------------------------------------------------------------------------//
 
CMD:varmour(playerid, params[])
{
if(vipszint[playerid] >= 1)
{
SetPlayerArmour(playerid,100.0);
}
else
    {
    SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
    }
return 1;
}
CMD:vcar(playerid, params[])
{
if(vipszint[playerid] >=1)
{
new Index;
    new tmp[256];  tmp  = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
new tmp3[256]; tmp3 = strtok(params,Index);
    if(!strlen(tmp)) return SendClientMessage(playerid, red, \"Használat: /vcar [modellid/jármûnév] [szín1] [szín2]\");
new car, string[128], colour1, colour2;
if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp);
else car = strval(tmp);
if(car < 400 || car > 611) return  SendClientMessage(playerid, red, \"Használat: /vcar [modellid/jármûnév] [szín1] [szín2]\");
if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
    if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]);
new Float:X,Float:Y,Float:Z;
new Float:Angle,int1;
new LVehicleID = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
int1 = GetPlayerInterior(playerid);
SpawnedVehicles[playerid] = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);
LinkVehicleToInterior(LVehicleID,int1);
PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0);
format(string, sizeof(string), \"Jármû sikeresen lekérve!\");
return SendClientMessage(playerid, green, string);
}
else
    {
    SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
    }
return 1;
}
CMD:vcolor(playerid, params[])
{
if(vipszint[playerid] >= 1)
ShowPlayerDialog(playerid, 4949, DIALOG_STYLE_LIST, \"Színek\", \"{000000}Color1\\n{FFFFFF}Color2\\n{FF0000}Color3\\n{ff006f}Color4\\n{ff00d5}Color5\\n{f700ff}Color6\\n{d500ff}Color7\\n{8400ff}Color8\\n{5100ff}Color9\\n{0900ff}Color10\\n{003cff}Color11\\n{006fff}Color12\\n{0099ff}Color13\\n{00c4ff}Color14\\n{00eaff}Color15\\n{00ffc4}Color16\\n{00ff99}Color17\\n{00ff51}Color18\\n{00ff00}Color19\\n{51ff00}Color20\\n{7bff00}Color21\\n{aeff00}Color22\\n{ffff00}Color23\\n{ff9900}Color24\\n{ff5e00}Color25\", \"Kiválaszt\", \"Kilépés\");
}
CMD:vfix(playerid, params[])
#pragma unused params
{
if(vipszint[playerid] >= 1)
        {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, red, \"Nem vagy jármûben!\");
        return RepairVehicle(GetPlayerVehicleID(playerid)),  SendClientMessage(playerid, green, \"Jármû megjavítva!\");
        }
        else
            {
   SendClientMessage(playerid, red, \"HIBA: Nem vagy VIP tag!\");
   }
return 1;
}
CMD:vgoto(playerid,params[])
{
    if(vipszint[playerid] >= 1) {
    if(!strlen(params)) return SendClientMessage( playerid, red, \"Használat: /vgoto [playerid]\" );
    new player1;
if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
      else player1 = strval(params);
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
   new Float:x, Float:y, Float:z;   GetPlayerPos(player1,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(player1));
   SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
   if(GetPlayerState(playerid) == 2) {
      SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z+3);   LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1));
      SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
   } else SetPlayerPos(playerid,x+2,y,z+3);
} else return SendClientMessage( playerid, red, \"Használat: /vgoto [playerid]\" );
} else return SendClientMessage(playerid,red,\"HIBA: Nem vagy VIP tag!\");
return 1;
}
CMD:vheal(playerid, params[])
{
if(vipszint[playerid] >= 1)
{
SetPlayerHealth(playerid,100.0);
}
else
    {
    SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
    }
return 1;
}
CMD:vjetpack(playerid, params[])
{
if(vipszint[playerid] >= 1)
{
    SetPlayerSpecialAction(playerid,2);
    }
    else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
    return 1;
}
CMD:vlockcar(playerid, params[])
{
    if(vipszint[playerid] >= 1)
    {
        if(!IsPlayerInAnyVehicle(playerid))
            return SendClientMessage(playerid,0xFFFFFFAA,\"You have to be inside a vehicle.\");
        if(GetPlayerVehicleSeat(playerid) != 0)
            return SendClientMessage(playerid,0xFFFFFFAA,\"You have to be a driver.\");
        if(PlayerCar[playerid] != -1)
        {
            LockedCar[PlayerCar[playerid]] = 0;
        }
        PlayerCar[playerid] = GetPlayerVehicleID(playerid);
        LockedCar[GetPlayerVehicleID(playerid)] = 1;
        return 1;
    }
    else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
    return 1;
}
CMD:vsetmytime(playerid,params[])
{
if(vipszint[playerid] >= 1)
{
new time;
if(sscanf(params,\"i\",time))SendClientMessage(playerid,COLOR_GREEN,\"Használat: /vsetmytime 0-24\");
if(time < 0 || time > 24) return SendClientMessage(playerid, 0xbbff00aa, \"Használat: /vsetmytime 0-24\");
SetPlayerTime(playerid,time, time);
return 1;
}
    else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
    return 1;
}
CMD:vsetmyweather(playerid,params[])
{
if(vipszint[playerid] >= 1)
    ShowPlayerDialog(playerid, 4951, DIALOG_STYLE_LIST, \"Weathers:\", \"{FFFFFF}Kék egek\\n{FFFFFF}Viharos\\n{FFFFFF}Felhõs és Ködös\\n{FFFFFF}Hõhullám\\n{FFFFFF}Homok vihar\\n{FFFFFF}Ködös, zöldes\", \"Kiválaszt\", \"Kilépés\");
}
CMD:vunlockcar(playerid, params[])
{
if(vipszint[playerid] >= 1)
{
        if(!IsPlayerInAnyVehicle(playerid))
            return SendClientMessage(playerid,0xFFFFFFAA,\"You have to be inside a vehicle.\");
        if(GetPlayerVehicleSeat(playerid) != 0)
            return SendClientMessage(playerid,0xFFFFFFAA,\"You have to be a driver.\");
        PlayerCar[playerid] = -1;
        LockedCar[GetPlayerVehicleID(playerid)] = 0;
        return 1;
    }
            else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
    return 1;
}
//----------------------------------------------------------------------------//
//---------------------------VIP 2. szintû parancsok--------------------------//
//----------------------------------------------------------------------------//
 
CMD:vann(playerid, params[])
{
if(vipszint[playerid] == 2)
{
if(!strlen(params)) return SendClientMessage(playerid,red,\"Használat: /vann <szöveg>\");
return GameTextForAll(params,4000,3);
    } else return SendClientMessage(playerid,red,\"HIBA: Nem vagy VIP tag!\");
}
CMD:varmourall(playerid, params[])
{
if(vipszint[playerid] == 2)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerArmour(i,100.0);
}
}
else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
return 1;
}
CMD:veject(playerid, params[])
{
if(vipszint[playerid] == 2)
if(sscanf(params,\"u\",playerid)) SendClientMessage( playerid, red, \"Használat: /veject [playerid]\");
else
{
    if(playerid == INVALID_PLAYER_ID) SendClientMessage( playerid, red, \"HIBA: A játékos nem található!\");
    else
        {
        RemovePlayerFromVehicle(playerid);
           }
}
else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
return 1;
}
CMD:vget(playerid, params[])
{
new PID;
new Float:x, Float:y, Float:z;
    if(vipszint[playerid] == 2)
    if ( sscanf( params, \"u\", PID ) ) return SendClientMessage( playerid, red, \"Használat: /vget [playerid]\" );
if ( IsPlayerConnected( PID ) && PID != INVALID_PLAYER_ID && PID != playerid )
{
GetPlayerPos( playerid, x, y, z );
    SetPlayerInterior( PID, GetPlayerInterior( playerid ) );
SetPlayerVirtualWorld( PID, GetPlayerVirtualWorld( playerid ) );
if ( GetPlayerState( PID ) == 2 )
{
    new VehicleID = GetPlayerVehicleID( PID );
   SetVehiclePos( VehicleID, x+3, y, z);
   LinkVehicleToInterior( VehicleID, GetPlayerInterior( PID ) );
   SetVehicleVirtualWorld( GetPlayerVehicleID( PID ), GetPlayerVirtualWorld( PID ) );
} else {
   SetPlayerPos( PID, x+2, y, z );
   }
   }
   else
   {
   SendClientMessage (playerid, red, \"HIBA: Nem vagy VIP tag!\");
   }
return 1;
}
CMD:vhealall(playerid, params[])
{
if(vipszint[playerid] == 2)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerHealth(i,100.0);
}
}
else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
return 1;
}
CMD:vhide(playerid, params[])
{
        if(vipszint[playerid] == 2)
        {
                SetPlayerColor(playerid, 0xFFFFFF00);
        }
        return 1;
}
CMD:vkick(playerid, params[])
{
if(vipszint[playerid] == 2)
if(sscanf(params,\"u\",playerid)) SendClientMessage( playerid, red, \"Használat: /vkick [playerid]\");
else
{
    if(playerid == INVALID_PLAYER_ID) SendClientMessage( playerid, red, \"HIBA: A játékos nem található!\");
    else
        {
        Kick(playerid);
           }
}
   else
            {
   SendClientMessage(playerid, red, \"HIBA: Nem vagy VIP tag!\");
   }
return 1;
}
CMD:vrac(playerid, params[])
{
if(vipszint[playerid] == 2)
{
if(sscanf(params, \"d\", vehicletime)) return SendClientMessage(playerid, red, \"Használat: /vrac [1-10]\");
if(vehicletime < 1 || vehicletime > 10) return SendClientMessage(playerid, red, \"Használat: /vrac [1-10]!\");
    vehicletimer = vehicletime;
    vehtimer = SetTimer(\"VehicleRespawn\", 1000, true);
    new string[128], sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), \"* Minden használaton kívüli jármû repsawnolva lesz %d másodperc múlva.\", vehicletime, sendername);
    SendClientMessageToAll(0xFF9900AA, string);
    }
    else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
return 1;
}
CMD:vsetallwanted(playerid,params[])
{
if(vipszint[playerid] == 2)
{
    if(!strlen(params)) return SendClientMessage(playerid, red, \"Használat: /vsetallwanted [körözési szint]\");
new var = strval(params);
for(new i = 0; i < MAX_PLAYERS; i++) {
   if(IsPlayerConnected(i)) {
   SetPlayerWantedLevel(i,var);
   }
}
} else return SendClientMessage(playerid,red,\"HIBA: Nem vagy VIP tag!\");
return 1;
}
CMD:vsetarmour(playerid,params[])
{
if(vipszint[playerid] == 2)
{
    new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
    if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, \"USAGE: /vsetarmour [playerid] [érték]\");
if(strval(tmp2) < 0 || strval(tmp2) > 100) return SendClientMessage(playerid, red, \"HIBA: Rossz érték 0-100\");
new player1 = strval(tmp), armour = strval(tmp2), string[128];
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
   format(string, sizeof(string), \"You have set \\\"%s\'s\\\" armour to \'%d\", pName(player1), armour); SendClientMessage(playerid,blue,string);
   if(player1 != playerid) { format(string,sizeof(string),\"VIP \\\"%s\\\" has set your armour to \'%d\'\", pName(playerid), armour); SendClientMessage(player1,blue,string); }
            return SetPlayerArmour(player1, armour);
    } else return SendClientMessage(playerid,red,\"HIBA: Rossz playerid!\");
} else return SendClientMessage(playerid,red,\"HIBA: Nem vagy VIP tag!\");
}
CMD:vsethealth(playerid,params[])
{
if(vipszint[playerid] == 2)
{
    new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
    if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, \"Használat: /vsethealth [playerid] [érték]\");
if(strval(tmp2) < 10 || strval(tmp2) > 100) return SendClientMessage(playerid, red, \"HIBA: Rossz érték (10-100)\");
new player1 = strval(tmp), health = strval(tmp2), string[128];
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
   if(player1 != playerid) { format(string,sizeof(string),\"VIP \\\"%s\\\" has set your health to \'%d\'\", pName(playerid), health); SendClientMessage(player1,blue,string); }
            return SetPlayerHealth(player1, health);
    } else return SendClientMessage(playerid,red,\"HIBA: Rossz playerid!\");
} else return SendClientMessage(playerid,red,\"HIBA: Nem vagy VIP tag!\");
}
CMD:vunhide(playerid, params[])
{
        if(vipszint[playerid] == 2)
        {
                SetPlayerColor(playerid, 0x09ff00AA);
        }
        return 1;
}
//-----------------------------Stocks----------------------------------------//
 
stock GetVehicleModelIDFromName(vname[]) {
for(new i = 0; i < 211; i++) {
if ( strfind(VehicleNames, vname, true) != -1 ) return i + 400;
}
return -1;
}
stock IsNumeric(string[]) {
for (new i = 0, j = strlen(string);   i < j; i++) {
if (string > \'9\' || string < \'0\') return 0;
}
return 1;
}
stock ReturnPlayerID(PlayerName[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
   if(strfind(pName(i),PlayerName,true)!=-1) return i;
}
}
return INVALID_PLAYER_ID;
}
stock pName(playerid)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, sizeof(name));
  return name;
}
CMD:vsaw(playerid, params[])
{
return cmd_vsetallwanted(playerid, params);
}
#define PRESSED(%0) \\
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_SUBMISSION))
{
        if(vipszint[playerid] >= 1)
   RepairVehicle(GetPlayerVehicleID(playerid)),  SendClientMessage(playerid, green, \"Jármû megjavítva!\");
}
return 1;
}
//---respawncars---//
public VehicleRespawn()
{
--vehicletimer;
if( !vehicletimer )   {
new vehid;
    while(vehid < MAX_VEHICLES)
    {
        if(!IsVehicleOccupied(vehid))
        {
            SetVehicleToRespawn(vehid);
        }
        vehid++;
    }
KillTimer(vehtimer);
return;
}
static string[ 3 ];
format( string, 3, \"%d\", vehicletimer );
GameTextForAll(string, 1000, 6 );
}
stock IsVehicleOccupied ( vehicleid )
{
new i;
while(i < MAX_PLAYERS)
{
if ( IsPlayerInVehicle ( i, vehicleid ) ) return 1;
i++;
}
return 0;
}
forward SendVipMessage( color, const string[ ] );
public SendVipMessage( color, const string[ ] )
{
for ( new i = 0; i < MAX_PLAYERS; i++ )
{
if ( IsPlayerConnected( i ) )
{
   if ( vipszint[ i ] >= 1 )
   {
       SendClientMessage( i, color, string );
   }
}
}
return 1;
}
 
//------------------------------Lockcar Cuccok--------------------------------//
 
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(LockedCar[vehicleid] == 1 && PlayerCar[playerid] != vehicleid)
    {
        if(MsgLocked[playerid] == 1)
        {
            TextDrawHideForPlayer(playerid, Locked);
            MsgLocked[playerid] = 0;
            KillTimer(LockedTimer[playerid]);
        }
        TogglePlayerControllable(playerid, true);
Locked = TextDrawCreate(10.0, 250.0, \"This Vehicle is Locked\");
        TextDrawUseBox(Locked, 1);
        TextDrawBoxColor(Locked, 0x00000055);
        TextDrawTextSize(Locked, 125, 5);
        TextDrawShowForPlayer(playerid, Locked);
        LockedTimer[playerid] = SetTimer(\"RemoveLock\", 4000, false);
        MsgLocked[playerid] = 1;
    }
    return 1;
}
public RemoveLock(playerid)
{
    if(MsgLocked[playerid] == 1)
    {
        TextDrawHideForPlayer(playerid, Locked);
        MsgLocked[playerid] = 0;
    }
}
public OnVehicleSpawn(vehicleid)
{
    LockedCar[vehicleid] = 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerCar == vehicleid)
            PlayerCar = -1;
    }
    return 1;
}
 
//------------------------------DIALOGS---------------------------------------//
 
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 4949)
{
if(response)
{
if(listitem == 0)
{
SetPlayerColor(playerid,0x000000AA);
}
if(listitem == 1)
{
SetPlayerColor(playerid,0xffffffAA);
}
if(listitem == 2)
{
SetPlayerColor(playerid,red);
}
if(listitem == 3)
{
SetPlayerColor(playerid,0xff006fAA);
}
if(listitem == 4)
{
SetPlayerColor(playerid,0xff00d5AA);
}
if(listitem == 5)
{
SetPlayerColor(playerid,0xf700ffAA);
}
if(listitem == 6)
{
SetPlayerColor(playerid,0xd500ffAA);
}
if(listitem == 7)
{
SetPlayerColor(playerid,0x8400ffAA);
}
if(listitem == 8)
{
SetPlayerColor(playerid,0x5100ffAA);
}
if(listitem == 9)
{
SetPlayerColor(playerid,0x0900ffAA);
}
if(listitem == 10)
{
SetPlayerColor(playerid,0x003cffAA);
}
if(listitem == 11)
{
SetPlayerColor(playerid,0x006fffAA);
}
if(listitem == 12)
{
SetPlayerColor(playerid,0x0099ffAA);
}
if(listitem == 13)
{
SetPlayerColor(playerid,0x00c4ffAA);
}
if(listitem == 14)
{
SetPlayerColor(playerid,0x00eaffAA);
}
if(listitem == 15)
{
SetPlayerColor(playerid,0x00ffc4AA);
}
if(listitem == 16)
{
SetPlayerColor(playerid,0x00ff99AA);
}
if(listitem == 17)
{
SetPlayerColor(playerid,0x00ff51AA);
}
if(listitem == 18)
{
SetPlayerColor(playerid,0x00ff00AA);
}
if(listitem == 19)
{
SetPlayerColor(playerid,0x51ff00AA);
}
if(listitem == 20)
{
SetPlayerColor(playerid,0x7bff00AA);
}
if(listitem == 21)
{
SetPlayerColor(playerid,0xaeff00AA);
}
if(listitem == 22)
{
SetPlayerColor(playerid,0xffff00AA);
}
if(listitem == 23)
{
SetPlayerColor(playerid,0xff9900AA);
}
if(listitem == 24)
{
SetPlayerColor(playerid,0xff5e00AA);
}
}
return 1;
}
if(dialogid == 4951)
{
if(response)
{
if(listitem == 0)
{
SetPlayerWeather(playerid, 0);
}
if(listitem == 1)
{
SetPlayerWeather(playerid, 8);
}
if(listitem == 2)
{
SetPlayerWeather(playerid, 9);
}
if(listitem == 3)
{
SetPlayerWeather(playerid, 11);
}
if(listitem == 4)
{
SetPlayerWeather(playerid, 19);
}
if(listitem == 5)
{
SetPlayerWeather(playerid, 20);
}
}
return 1;
}
return 0;
}
« Utoljára szerkesztve: 2014. április 25. - 23:00:56 írta BoOy »

Vip rendszer
« Válasz #1 Dátum: 2014. április 26. - 09:05:31 »
0 Show voters
Mondjuk az a két hiba eléggé zavaró,de azért grat

Nem elérhető Lucio

  • 232
    • Profil megtekintése
Vip rendszer
« Válasz #2 Dátum: 2014. április 26. - 09:55:39 »
0 Show voters
vipszint[playerid] = szint;

 
Helyett
 
vipszint[id] = szint;

 
Mivel oda adja a PLAYERID-nek azaz annak aki beírta a parancsot, de lementi annak a fájlába akinek adtad, és azért csak akkor aktiválódik neki a szint, ha reconnectel, mert a fájlból olvassa be...

Vip rendszer
« Válasz #3 Dátum: 2014. április 26. - 13:48:29 »
0 Show voters
értem , köszönöm szépen a segítséget és a magyarázatot is :D
« Utoljára szerkesztve: 2014. április 26. - 13:53:46 írta _[G]M[K]_Sh1ft_ »

Vip rendszer
« Válasz #4 Dátum: 2014. április 25. - 21:59:28 »
0 Show voters
Sziasztok!
Pár nappal ezelõtt készítettem egy VIP rendszert remélem tetszeni fog. Annyi a hibája hogy ha Vipet adok vkinek akkor csak akkor adja meg neki mikor újra feljön. És ahanyas szintet állítok be y playernek olyan lesz az én szintem is. Ez a két hibája van.
VIP 1-es szintû parancsok:
/varmour /vcar /vcolor /vfix /vheal
/vjetpack /vlockcar /vgoto
/vsetmytime /vsetmyweather /vunlockcar
VIP 2-es szintû parancsok:
/vann /varmour /varmourall /vcar /vcolor /vfix /vget /vgoto /vheal
/vhealall /vhide /vjetpack /vkick /vlockcar /vrac /vsetallwanted
/vsetarmour /vsethealth /vsetmytime /vsetmyweather /vunhide /vunlockcar
RCON parancsai:
/vszint
Letöltés: http://www.mediafire.com/view/m95jrz33uwcxwzc/VIP_System.zip
CODE
 

/*
                  VIP System by: _[G]M[K]_Sh1ft_
*/
#include <a_samp>
#include <dini>
#include <dudb>
#include <zcmd>
#include <sscanf2>
#include <fixchars>
#pragma tabsize 0
#pragma unused ret_memcpy
#define red 0xFF0000AA
#define green 0x00ff09AA
#define COLOR_GREEN 0x33AA33AA
#define blue 0x375FFFFF
//-------VIP System-------//
new nev[MAX_PLAYER_NAME];
new vipszint[MAX_PLAYERS];
//---Jármû respawn cuccok---//
new vehicletimer, vehtimer;
new vehicletime;
//---Jármû lehívó cuccok---//
new SpawnedVehicles[MAX_PLAYERS];
new VehicleNames[212][] = {
{\"Landstalker\"},{\"Bravura\"},{\"Buffalo\"},{\"Linerunner\"},{\"Perrenial\"},{\"Sentinel\"},{\"Dumper\"},{\"Firetruck\"},{\"Trashmaster\"},{\"Stretch\"},{\"Manana\"},{\"Infernus\"},{\"Voodoo\"},{\"Pony\"},{\"Mule\"},
{\"Cheetah\"},{\"Ambulance\"},{\"Leviathan\"},{\"Moonbeam\"},{\"Esperanto\"},{\"Taxi\"},{\"Washington\"},{\"Bobcat\"},{\"Mr Whoopee\"},{\"BF Injection\"},{\"Hunter\"},{\"Premier\"},{\"Enforcer\"},{\"Securicar\"},
{\"Banshee\"},{\"Predator\"},{\"Bus\"},{\"Rhino\"},{\"Barracks\"},{\"Hotknife\"},{\"Trailer 1\"},{\"Previon\"},{\"Coach\"},{\"Cabbie\"},{\"Stallion\"},{\"Rumpo\"},{\"RC Bandit\"},{\"Romero\"},{\"Packer\"},{\"Monster\"},
{\"Admiral\"},{\"Squalo\"},{\"Seasparrow\"},{\"Pizzaboy\"},{\"Tram\"},{\"Trailer 2\"},{\"Turismo\"},{\"Speeder\"},{\"Reefer\"},{\"Tropic\"},{\"Flatbed\"},{\"Yankee\"},{\"Caddy\"},{\"Solair\"},{\"Berkley\'s RC Van\"},
{\"Skimmer\"},{\"PCJ-600\"},{\"Faggio\"},{\"Freeway\"},{\"RC Baron\"},{\"RC Raider\"},{\"Glendale\"},{\"Oceanic\"},{\"Sanchez\"},{\"Sparrow\"},{\"Patriot\"},{\"Quad\"},{\"Coastguard\"},{\"Dinghy\"},{\"Hermes\"},{\"Sabre\"},
{\"Rustler\"},{\"ZR-350\"},{\"Walton\"},{\"Regina\"},{\"Comet\"},{\"BMX\"},{\"Burrito\"},{\"Camper\"},{\"Marquis\"},{\"Baggage\"},{\"Dozer\"},{\"Maverick\"},{\"News Chopper\"},{\"Rancher\"},{\"FBI Rancher\"},{\"Virgo\"},{\"Greenwood\"},
{\"Jetmax\"},{\"Hotring\"},{\"Sandking\"},{\"Blista Compact\"},{\"Police Maverick\"},{\"Boxville\"},{\"Benson\"},{\"Mesa\"},{\"RC Goblin\"},{\"Hotring Racer A\"},{\"Hotring Racer B\"},{\"Bloodring Banger\"},{\"Rancher\"},
{\"Super GT\"},{\"Elegant\"},{\"Journey\"},{\"Bike\"},{\"Mountain Bike\"},{\"Beagle\"},{\"Cropdust\"},{\"Stunt\"},{\"Tanker\"}, {\"Roadtrain\"},{\"Nebula\"},{\"Majestic\"},{\"Buccaneer\"},{\"Shamal\"},{\"Hydra\"},{\"FCR-900\"},
{\"NRG-500\"},{\"HPV1000\"},{\"Cement Truck\"},{\"Tow Truck\"},{\"Fortune\"},{\"Cadrona\"},{\"FBI Truck\"},{\"Willard\"},{\"Forklift\"},{\"Tractor\"},{\"Combine\"},{\"Feltzer\"},{\"Remington\"},{\"Slamvan\"},
{\"Blade\"},{\"Freight\"},{\"Streak\"},{\"Vortex\"},{\"Vincent\"},{\"Bullet\"},{\"Clover\"},{\"Sadler\"},{\"Firetruck LA\"},{\"Hustler\"},{\"Intruder\"},{\"Primo\"},{\"Cargobob\"},{\"Tampa\"},{\"Sunrise\"},{\"Merit\"},{\"Utility\"},{\"Nevada\"},{\"Yosemite\"},{\"Windsor\"},{\"Monster A\"},{\"Monster B\"},{\"Uranus\"},{\"Jester\"},
{\"Sultan\"},{\"Stratum\"},{\"Elegy\"},{\"Raindance\"},{\"RC Tiger\"},{\"Flash\"},{\"Tahoma\"},{\"Savanna\"},{\"Bandito\"},{\"Freight Flat\"},{\"Streak Carriage\"},{\"Kart\"},{\"Mower\"},{\"Duneride\"},{\"Sweeper\"},
{\"Broadway\"},{\"Tornado\"},{\"AT-400\"},{\"DFT-30\"},{\"Huntley\"},{\"Stafford\"},{\"BF-400\"},{\"Newsvan\"},{\"Tug\"},{\"Trailer 3\"},{\"Emperor\"},{\"Wayfarer\"},{\"Euros\"},{\"Hotdog\"},{\"Club\"},{\"Freight Carriage\"},
{\"Trailer 3\"},{\"Andromada\"},{\"Dodo\"},{\"RC Cam\"},{\"Launch\"},{\"Police Car (LSPD)\"},{\"Police Car (SFPD)\"},{\"Police Car (LVPD)\"},{\"Police Ranger\"},{\"Picador\"},{\"S.W.A.T. Van\"},{\"Alpha\"},{\"Phoenix\"},{\"Glendale\"},
{\"Sadler\"},{\"Luggage Trailer A\"},{\"Luggage Trailer B\"},{\"Stair Trailer\"},{\"Boxville\"},{\"Farm Plow\"},{\"Utility Trailer\"}
};
//---Lockcar cuccok---//
new PlayerCar[MAX_PLAYERS], LockedCar[1000];
new Text:Locked;
new MsgLocked[MAX_PLAYERS], LockedTimer[MAX_PLAYERS];
forward RemoveLock(playerid);
//---Jármû respawn cuccok---//
forward VehicleRespawn();
forward CheckTimer();
public OnPlayerDisconnect(playerid, reason)
{
vipszint[playerid]= 0;
}
public OnPlayerConnect(playerid)
{
    new file[128];
GetPlayerName(playerid,nev,sizeof(nev));
format(file,sizeof(file),\"/Karakterek/%s.ini\",nev);
    vipszint[playerid] = dini_Int(file,\"vipszint\");
    PlayerCar[playerid] = -1;
return 1;
}
 
public OnPlayerText( playerid, text[ ] )
{
new textstr[ 128 ];
if ( text[ 0 ] == \'!\' && vipszint[playerid] >= 1 )
{
GetPlayerName( playerid, textstr, sizeof( textstr ) );
format( textstr, sizeof( textstr ),\"VIP-Chat: {00FF00}%s:{FF5500} %s\", textstr, text[ 1 ] );
SendVipMessage( red, textstr );
return 0;
}
return 1;
}
CMD:vszint(playerid,params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new id,szint;
        new neve[MAX_PLAYER_NAME];
        if(sscanf(params,\"ui\",id,szint))return SendClientMessage(playerid,-1,\"Használat: /vszint [Player ID] [szint]\");
        if(szint < 0 || szint > 2) return SendClientMessage(playerid,-1,\"A szintnek 0 és 2 között kell lennie!\");
        vipszint[playerid] = szint;
      new file[128];
      GetPlayerName(id,neve,sizeof(neve));
      format(file,sizeof(file),\"/Karakterek/%s.ini\",neve);
      dini_Create(file);
      dini_IntSet(file,\"vipszint\",vipszint[playerid]);
              GetPlayerName(playerid,nev,sizeof(nev));
              GetPlayerName(id,neve,sizeof(neve));
              new string[128];
              format(string,sizeof(string),\"%s megváltoztatta a vipszintedet erre: %d\",nev,szint);
              SendClientMessage(id,-1,string);
              format(string,sizeof(string),\"Megváltoztattad %s vipszintjét erre: %d\",neve,szint);
              SendClientMessage(playerid,-1,string);
              printf(\"%s megváltoztatta %s vipszintjét erre: %d\",nev,neve,szint);
    }
    else SendClientMessage(playerid,-1,\"Nem vagy rcon admin!\");
return 1;
}
CMD:vcmds(playerid, params[])
{
    if(vipszint[playerid] == 1) //11 parancs
    {
SendClientMessage(playerid, red, \"--------------------Parancsok--------------------\");
    SendClientMessage(playerid, green, \"/varmour /vcar /vcolor /vfix /vheal\");
    SendClientMessage(playerid, green, \"/vjetpack /vlockcar /vgoto\");
    SendClientMessage(playerid, green, \"/vsetmytime /vsetmyweather /vunlockcar\");
    SendClientMessage(playerid, red, \"------------------------------------------------------\");
    SendClientMessage(playerid, red, \"VIP chat: {00ff09}!(szöveg)\");
    return 1;
    }
else
{
if(vipszint[playerid] == 2) //22 parancs
    {
SendClientMessage(playerid, red, \"-----------------------------------------------Parancsok----------------------------------------------\");
       SendClientMessage(playerid, green, \"/vann /varmour /varmourall /vcar /vcolor /vfix /vget /vgoto /vheal\");
       SendClientMessage(playerid, green, \"/vhealall /vhide /vjetpack /vkick /vlockcar /vrac /vsetallwanted\");
    SendClientMessage(playerid, green, \"/vsetarmour /vsethealth /vsetmytime /vsetmyweather /vunhide /vunlockcar\");
         SendClientMessage(playerid, red, \"-----------------------------------------------------------------------------------------------------------\");
       SendClientMessage(playerid, red, \"VIP chat: {00ff09}!(szöveg)\");
         }
           else
           {
           SendClientMessage(playerid, red, \"HIBA: Nem vagy VIP tag!\");
           }
           }
return 1;
}
//----------------------------------------------------------------------------//
//--------------------------------VIP Parancsok-------------------------------//
//---------------------------VIP 1. szintû parancsok--------------------------//
//----------------------------------------------------------------------------//
 
CMD:varmour(playerid, params[])
{
if(vipszint[playerid] >= 1)
{
SetPlayerArmour(playerid,100.0);
}
else
    {
    SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
    }
return 1;
}
CMD:vcar(playerid, params[])
{
if(vipszint[playerid] >=1)
{
new Index;
    new tmp[256];  tmp  = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
new tmp3[256]; tmp3 = strtok(params,Index);
    if(!strlen(tmp)) return SendClientMessage(playerid, red, \"Használat: /vcar [modellid/jármûnév] [szín1] [szín2]\");
new car, string[128], colour1, colour2;
if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp);
else car = strval(tmp);
if(car < 400 || car > 611) return  SendClientMessage(playerid, red, \"Használat: /vcar [modellid/jármûnév] [szín1] [szín2]\");
if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
    if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]);
new Float:X,Float:Y,Float:Z;
new Float:Angle,int1;
new LVehicleID = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
int1 = GetPlayerInterior(playerid);
SpawnedVehicles[playerid] = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);
LinkVehicleToInterior(LVehicleID,int1);
PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0);
format(string, sizeof(string), \"Jármû sikeresen lekérve!\");
return SendClientMessage(playerid, green, string);
}
else
    {
    SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
    }
return 1;
}
CMD:vcolor(playerid, params[])
{
if(vipszint[playerid] >= 1)
ShowPlayerDialog(playerid, 4949, DIALOG_STYLE_LIST, \"Színek\", \"{000000}Color1\\n{FFFFFF}Color2\\n{FF0000}Color3\\n{ff006f}Color4\\n{ff00d5}Color5\\n{f700ff}Color6\\n{d500ff}Color7\\n{8400ff}Color8\\n{5100ff}Color9\\n{0900ff}Color10\\n{003cff}Color11\\n{006fff}Color12\\n{0099ff}Color13\\n{00c4ff}Color14\\n{00eaff}Color15\\n{00ffc4}Color16\\n{00ff99}Color17\\n{00ff51}Color18\\n{00ff00}Color19\\n{51ff00}Color20\\n{7bff00}Color21\\n{aeff00}Color22\\n{ffff00}Color23\\n{ff9900}Color24\\n{ff5e00}Color25\", \"Kiválaszt\", \"Kilépés\");
}
CMD:vfix(playerid, params[])
#pragma unused params
{
if(vipszint[playerid] >= 1)
        {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, red, \"Nem vagy jármûben!\");
        return RepairVehicle(GetPlayerVehicleID(playerid)),  SendClientMessage(playerid, green, \"Jármû megjavítva!\");
        }
        else
            {
   SendClientMessage(playerid, red, \"HIBA: Nem vagy VIP tag!\");
   }
return 1;
}
CMD:vgoto(playerid,params[])
{
    if(vipszint[playerid] >= 1) {
    if(!strlen(params)) return SendClientMessage( playerid, red, \"Használat: /vgoto [playerid]\" );
    new player1;
if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
      else player1 = strval(params);
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
   new Float:x, Float:y, Float:z;   GetPlayerPos(player1,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(player1));
   SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
   if(GetPlayerState(playerid) == 2) {
      SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z+3);   LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1));
      SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
   } else SetPlayerPos(playerid,x+2,y,z+3);
} else return SendClientMessage( playerid, red, \"Használat: /vgoto [playerid]\" );
} else return SendClientMessage(playerid,red,\"HIBA: Nem vagy VIP tag!\");
return 1;
}
CMD:vheal(playerid, params[])
{
if(vipszint[playerid] >= 1)
{
SetPlayerHealth(playerid,100.0);
}
else
    {
    SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
    }
return 1;
}
CMD:vjetpack(playerid, params[])
{
if(vipszint[playerid] >= 1)
{
    SetPlayerSpecialAction(playerid,2);
    }
    else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
    return 1;
}
CMD:vlockcar(playerid, params[])
{
    if(vipszint[playerid] >= 1)
    {
        if(!IsPlayerInAnyVehicle(playerid))
            return SendClientMessage(playerid,0xFFFFFFAA,\"You have to be inside a vehicle.\");
        if(GetPlayerVehicleSeat(playerid) != 0)
            return SendClientMessage(playerid,0xFFFFFFAA,\"You have to be a driver.\");
        if(PlayerCar[playerid] != -1)
        {
            LockedCar[PlayerCar[playerid]] = 0;
        }
        PlayerCar[playerid] = GetPlayerVehicleID(playerid);
        LockedCar[GetPlayerVehicleID(playerid)] = 1;
        return 1;
    }
    else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
    return 1;
}
CMD:vsetmytime(playerid,params[])
{
if(vipszint[playerid] >= 1)
{
new time;
if(sscanf(params,\"i\",time))SendClientMessage(playerid,COLOR_GREEN,\"Használat: /vsetmytime 0-24\");
if(time < 0 || time > 24) return SendClientMessage(playerid, 0xbbff00aa, \"Használat: /vsetmytime 0-24\");
SetPlayerTime(playerid,time, time);
return 1;
}
    else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
    return 1;
}
CMD:vsetmyweather(playerid,params[])
{
if(vipszint[playerid] >= 1)
    ShowPlayerDialog(playerid, 4951, DIALOG_STYLE_LIST, \"Weathers:\", \"{FFFFFF}Kék egek\\n{FFFFFF}Viharos\\n{FFFFFF}Felhõs és Ködös\\n{FFFFFF}Hõhullám\\n{FFFFFF}Homok vihar\\n{FFFFFF}Ködös, zöldes\", \"Kiválaszt\", \"Kilépés\");
}
CMD:vunlockcar(playerid, params[])
{
if(vipszint[playerid] >= 1)
{
        if(!IsPlayerInAnyVehicle(playerid))
            return SendClientMessage(playerid,0xFFFFFFAA,\"You have to be inside a vehicle.\");
        if(GetPlayerVehicleSeat(playerid) != 0)
            return SendClientMessage(playerid,0xFFFFFFAA,\"You have to be a driver.\");
        PlayerCar[playerid] = -1;
        LockedCar[GetPlayerVehicleID(playerid)] = 0;
        return 1;
    }
            else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
    return 1;
}
//----------------------------------------------------------------------------//
//---------------------------VIP 2. szintû parancsok--------------------------//
//----------------------------------------------------------------------------//
 
CMD:vann(playerid, params[])
{
if(vipszint[playerid] == 2)
{
if(!strlen(params)) return SendClientMessage(playerid,red,\"Használat: /vann <szöveg>\");
return GameTextForAll(params,4000,3);
    } else return SendClientMessage(playerid,red,\"HIBA: Nem vagy VIP tag!\");
}
CMD:varmourall(playerid, params[])
{
if(vipszint[playerid] == 2)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerArmour(i,100.0);
}
}
else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
return 1;
}
CMD:veject(playerid, params[])
{
if(vipszint[playerid] == 2)
if(sscanf(params,\"u\",playerid)) SendClientMessage( playerid, red, \"Használat: /veject [playerid]\");
else
{
    if(playerid == INVALID_PLAYER_ID) SendClientMessage( playerid, red, \"HIBA: A játékos nem található!\");
    else
        {
        RemovePlayerFromVehicle(playerid);
           }
}
else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
return 1;
}
CMD:vget(playerid, params[])
{
new PID;
new Float:x, Float:y, Float:z;
    if(vipszint[playerid] == 2)
    if ( sscanf( params, \"u\", PID ) ) return SendClientMessage( playerid, red, \"Használat: /vget [playerid]\" );
if ( IsPlayerConnected( PID ) && PID != INVALID_PLAYER_ID && PID != playerid )
{
GetPlayerPos( playerid, x, y, z );
    SetPlayerInterior( PID, GetPlayerInterior( playerid ) );
SetPlayerVirtualWorld( PID, GetPlayerVirtualWorld( playerid ) );
if ( GetPlayerState( PID ) == 2 )
{
    new VehicleID = GetPlayerVehicleID( PID );
   SetVehiclePos( VehicleID, x+3, y, z);
   LinkVehicleToInterior( VehicleID, GetPlayerInterior( PID ) );
   SetVehicleVirtualWorld( GetPlayerVehicleID( PID ), GetPlayerVirtualWorld( PID ) );
} else {
   SetPlayerPos( PID, x+2, y, z );
   }
   }
   else
   {
   SendClientMessage (playerid, red, \"HIBA: Nem vagy VIP tag!\");
   }
return 1;
}
CMD:vhealall(playerid, params[])
{
if(vipszint[playerid] == 2)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerHealth(i,100.0);
}
}
else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
return 1;
}
CMD:vhide(playerid, params[])
{
        if(vipszint[playerid] == 2)
        {
                SetPlayerColor(playerid, 0xFFFFFF00);
        }
        return 1;
}
CMD:vkick(playerid, params[])
{
if(vipszint[playerid] == 2)
if(sscanf(params,\"u\",playerid)) SendClientMessage( playerid, red, \"Használat: /vkick [playerid]\");
else
{
    if(playerid == INVALID_PLAYER_ID) SendClientMessage( playerid, red, \"HIBA: A játékos nem található!\");
    else
        {
        Kick(playerid);
           }
}
   else
            {
   SendClientMessage(playerid, red, \"HIBA: Nem vagy VIP tag!\");
   }
return 1;
}
CMD:vrac(playerid, params[])
{
if(vipszint[playerid] == 2)
{
if(sscanf(params, \"d\", vehicletime)) return SendClientMessage(playerid, red, \"Használat: /vrac [1-10]\");
if(vehicletime < 1 || vehicletime > 10) return SendClientMessage(playerid, red, \"Használat: /vrac [1-10]!\");
    vehicletimer = vehicletime;
    vehtimer = SetTimer(\"VehicleRespawn\", 1000, true);
    new string[128], sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), \"* Minden használaton kívüli jármû repsawnolva lesz %d másodperc múlva.\", vehicletime, sendername);
    SendClientMessageToAll(0xFF9900AA, string);
    }
    else
{
SendClientMessage( playerid, red, \"HIBA: Nem vagy VIP tag!\");
}
return 1;
}
CMD:vsetallwanted(playerid,params[])
{
if(vipszint[playerid] == 2)
{
    if(!strlen(params)) return SendClientMessage(playerid, red, \"Használat: /vsetallwanted [körözési szint]\");
new var = strval(params);
for(new i = 0; i < MAX_PLAYERS; i++) {
   if(IsPlayerConnected(i)) {
   SetPlayerWantedLevel(i,var);
   }
}
} else return SendClientMessage(playerid,red,\"HIBA: Nem vagy VIP tag!\");
return 1;
}
CMD:vsetarmour(playerid,params[])
{
if(vipszint[playerid] == 2)
{
    new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
    if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, \"USAGE: /vsetarmour [playerid] [érték]\");
if(strval(tmp2) < 0 || strval(tmp2) > 100) return SendClientMessage(playerid, red, \"HIBA: Rossz érték 0-100\");
new player1 = strval(tmp), armour = strval(tmp2), string[128];
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
   format(string, sizeof(string), \"You have set \\\"%s\'s\\\" armour to \'%d\", pName(player1), armour); SendClientMessage(playerid,blue,string);
   if(player1 != playerid) { format(string,sizeof(string),\"VIP \\\"%s\\\" has set your armour to \'%d\'\", pName(playerid), armour); SendClientMessage(player1,blue,string); }
            return SetPlayerArmour(player1, armour);
    } else return SendClientMessage(playerid,red,\"HIBA: Rossz playerid!\");
} else return SendClientMessage(playerid,red,\"HIBA: Nem vagy VIP tag!\");
}
CMD:vsethealth(playerid,params[])
{
if(vipszint[playerid] == 2)
{
    new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
    if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, \"Használat: /vsethealth [playerid] [érték]\");
if(strval(tmp2) < 10 || strval(tmp2) > 100) return SendClientMessage(playerid, red, \"HIBA: Rossz érték (10-100)\");
new player1 = strval(tmp), health = strval(tmp2), string[128];
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
   if(player1 != playerid) { format(string,sizeof(string),\"VIP \\\"%s\\\" has set your health to \'%d\'\", pName(playerid), health); SendClientMessage(player1,blue,string); }
            return SetPlayerHealth(player1, health);
    } else return SendClientMessage(playerid,red,\"HIBA: Rossz playerid!\");
} else return SendClientMessage(playerid,red,\"HIBA: Nem vagy VIP tag!\");
}
CMD:vunhide(playerid, params[])
{
        if(vipszint[playerid] == 2)
        {
                SetPlayerColor(playerid, 0x09ff00AA);
        }
        return 1;
}
//-----------------------------Stocks----------------------------------------//
 
stock GetVehicleModelIDFromName(vname[]) {
for(new i = 0; i < 211; i++) {
if ( strfind(VehicleNames, vname, true) != -1 ) return i + 400;
}
return -1;
}
stock IsNumeric(string[]) {
for (new i = 0, j = strlen(string);   i < j; i++) {
if (string > \'9\' || string < \'0\') return 0;
}
return 1;
}
stock ReturnPlayerID(PlayerName[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
   if(strfind(pName(i),PlayerName,true)!=-1) return i;
}
}
return INVALID_PLAYER_ID;
}
stock pName(playerid)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, sizeof(name));
  return name;
}
CMD:vsaw(playerid, params[])
{
return cmd_vsetallwanted(playerid, params);
}
#define PRESSED(%0) \\
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_SUBMISSION))
{
        if(vipszint[playerid] >= 1)
   RepairVehicle(GetPlayerVehicleID(playerid)),  SendClientMessage(playerid, green, \"Jármû megjavítva!\");
}
return 1;
}
//---respawncars---//
public VehicleRespawn()
{
--vehicletimer;
if( !vehicletimer )   {
new vehid;
    while(vehid < MAX_VEHICLES)
    {
        if(!IsVehicleOccupied(vehid))
        {
            SetVehicleToRespawn(vehid);
        }
        vehid++;
    }
KillTimer(vehtimer);
return;
}
static string[ 3 ];
format( string, 3, \"%d\", vehicletimer );
GameTextForAll(string, 1000, 6 );
}
stock IsVehicleOccupied ( vehicleid )
{
new i;
while(i < MAX_PLAYERS)
{
if ( IsPlayerInVehicle ( i, vehicleid ) ) return 1;
i++;
}
return 0;
}
forward SendVipMessage( color, const string[ ] );
public SendVipMessage( color, const string[ ] )
{
for ( new i = 0; i < MAX_PLAYERS; i++ )
{
if ( IsPlayerConnected( i ) )
{
   if ( vipszint[ i ] >= 1 )
   {
       SendClientMessage( i, color, string );
   }
}
}
return 1;
}
 
//------------------------------Lockcar Cuccok--------------------------------//
 
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(LockedCar[vehicleid] == 1 && PlayerCar[playerid] != vehicleid)
    {
        if(MsgLocked[playerid] == 1)
        {
            TextDrawHideForPlayer(playerid, Locked);
            MsgLocked[playerid] = 0;
            KillTimer(LockedTimer[playerid]);
        }
        TogglePlayerControllable(playerid, true);
Locked = TextDrawCreate(10.0, 250.0, \"This Vehicle is Locked\");
        TextDrawUseBox(Locked, 1);
        TextDrawBoxColor(Locked, 0x00000055);
        TextDrawTextSize(Locked, 125, 5);
        TextDrawShowForPlayer(playerid, Locked);
        LockedTimer[playerid] = SetTimer(\"RemoveLock\", 4000, false);
        MsgLocked[playerid] = 1;
    }
    return 1;
}
public RemoveLock(playerid)
{
    if(MsgLocked[playerid] == 1)
    {
        TextDrawHideForPlayer(playerid, Locked);
        MsgLocked[playerid] = 0;
    }
}
public OnVehicleSpawn(vehicleid)
{
    LockedCar[vehicleid] = 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerCar == vehicleid)
            PlayerCar = -1;
    }
    return 1;
}
 
//------------------------------DIALOGS---------------------------------------//
 
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 4949)
{
if(response)
{
if(listitem == 0)
{
SetPlayerColor(playerid,0x000000AA);
}
if(listitem == 1)
{
SetPlayerColor(playerid,0xffffffAA);
}
if(listitem == 2)
{
SetPlayerColor(playerid,red);
}
if(listitem == 3)
{
SetPlayerColor(playerid,0xff006fAA);
}
if(listitem == 4)
{
SetPlayerColor(playerid,0xff00d5AA);
}
if(listitem == 5)
{
SetPlayerColor(playerid,0xf700ffAA);
}
if(listitem == 6)
{
SetPlayerColor(playerid,0xd500ffAA);
}
if(listitem == 7)
{
SetPlayerColor(playerid,0x8400ffAA);
}
if(listitem == 8)
{
SetPlayerColor(playerid,0x5100ffAA);
}
if(listitem == 9)
{
SetPlayerColor(playerid,0x0900ffAA);
}
if(listitem == 10)
{
SetPlayerColor(playerid,0x003cffAA);
}
if(listitem == 11)
{
SetPlayerColor(playerid,0x006fffAA);
}
if(listitem == 12)
{
SetPlayerColor(playerid,0x0099ffAA);
}
if(listitem == 13)
{
SetPlayerColor(playerid,0x00c4ffAA);
}
if(listitem == 14)
{
SetPlayerColor(playerid,0x00eaffAA);
}
if(listitem == 15)
{
SetPlayerColor(playerid,0x00ffc4AA);
}
if(listitem == 16)
{
SetPlayerColor(playerid,0x00ff99AA);
}
if(listitem == 17)
{
SetPlayerColor(playerid,0x00ff51AA);
}
if(listitem == 18)
{
SetPlayerColor(playerid,0x00ff00AA);
}
if(listitem == 19)
{
SetPlayerColor(playerid,0x51ff00AA);
}
if(listitem == 20)
{
SetPlayerColor(playerid,0x7bff00AA);
}
if(listitem == 21)
{
SetPlayerColor(playerid,0xaeff00AA);
}
if(listitem == 22)
{
SetPlayerColor(playerid,0xffff00AA);
}
if(listitem == 23)
{
SetPlayerColor(playerid,0xff9900AA);
}
if(listitem == 24)
{
SetPlayerColor(playerid,0xff5e00AA);
}
}
return 1;
}
if(dialogid == 4951)
{
if(response)
{
if(listitem == 0)
{
SetPlayerWeather(playerid, 0);
}
if(listitem == 1)
{
SetPlayerWeather(playerid, 8);
}
if(listitem == 2)
{
SetPlayerWeather(playerid, 9);
}
if(listitem == 3)
{
SetPlayerWeather(playerid, 11);
}
if(listitem == 4)
{
SetPlayerWeather(playerid, 19);
}
if(listitem == 5)
{
SetPlayerWeather(playerid, 20);
}
}
return 1;
}
return 0;
}
« Utoljára szerkesztve: 2014. április 25. - 23:00:56 írta BoOy »

Vip rendszer
« Válasz #5 Dátum: 2014. április 26. - 09:05:31 »
0 Show voters
Mondjuk az a két hiba eléggé zavaró,de azért grat

Nem elérhető Lucio

  • 232
    • Profil megtekintése
Vip rendszer
« Válasz #6 Dátum: 2014. április 26. - 09:55:39 »
0 Show voters
vipszint[playerid] = szint;

 
Helyett
 
vipszint[id] = szint;

 
Mivel oda adja a PLAYERID-nek azaz annak aki beírta a parancsot, de lementi annak a fájlába akinek adtad, és azért csak akkor aktiválódik neki a szint, ha reconnectel, mert a fájlból olvassa be...

Vip rendszer
« Válasz #7 Dátum: 2014. április 26. - 13:48:29 »
0 Show voters
értem , köszönöm szépen a segítséget és a magyarázatot is :D
« Utoljára szerkesztve: 2014. április 26. - 13:53:46 írta _[G]M[K]_Sh1ft_ »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal