Stats wont save Y_ini
#1

Need help for see my problem player stats(money, kill, death etc) wont to save because conflict with other save data? to much per enum/data to save? and can you make my gm to more simple data saving?

Код HTML:
//includes
#include <a_samp>
#include <zcmd>
#include <colors>
#include <mSelection>
#include <YSI\y_ini>
#include <sscanf2>

//defines
#define register 1
#define login 2
#define DIALOG_RCP             3
#define DIALOG_KICK            4
#define DIALOG_BAN             5
#define DIALOG_SLAP            6
#define DIALOG_EXPLODE         7
#define DIALOG_AKILL           8
#define DIALOG_FAKECHATID      9
#define DIALOG_FAKECHATMSG     10
#define DIALOG_MUTE            11
#define DIALOG_UNMUTE          12
#define DIALOG_WARN            13
#define DIALOG_UNWARN          14
#define DIALOG_ANIMS           15
#define MAX_WARNING 3
#define UserPath "/%s.ini"
#define PATH "/%s.ini"
#define SPECIAL_ACTION_PISSING 68

native WP_Hash(buffer[],len,const str[]);

enum PlayerInfo
{
    Pass[129], //User's password
    Adminlevel, //User's admin level
    VIPlevel, //User's vip level
    Money, //User's money
    Scores, //User's scores
    Kills, //User's kills
    Deaths //User's deaths
}

enum wInfo {

// Weapons
    Weapon1,
    Weapon2,
    Weapon3,
    Weapon4,
    Weapon5,
    Weapon6,
    Weapon7,
    Weapon8,
    Weapon9,
    Weapon10,
    Weapon11,
    Weapon12,

//Ammo
    Ammo1,
    Ammo2,
    Ammo3,
    Ammo4,
    Ammo5,
    Ammo6,
    Ammo7,
    Ammo8,
    Ammo9,
    Ammo10,
    Ammo11,
    Ammo12,
}

enum RCONInfo
{
	Mute,
	Freeze,
	Warn
};

enum Float:Pos{ Float:sX,Float:sY,Float:sZ };

new rInfo[MAX_PLAYERS][RCONInfo];
new WeaponInfo[MAX_PLAYERS][wInfo];
new pInfo[MAX_PLAYERS][PlayerInfo];
new Float:posX[MAX_PLAYERS];
new Float:posY[MAX_PLAYERS];
new Float:posZ[MAX_PLAYERS];
new Float:posA[MAX_PLAYERS];
new Interior[MAX_PLAYERS];
new VirtualWorld[MAX_PLAYERS];
new Saved[MAX_PLAYERS];
new Text:ShadowsRandom;
new vehiclelist = mS_INVALID_LISTID;
new skinlist = mS_INVALID_LISTID;
new weaponlist = mS_INVALID_LISTID;
new DropLimit = 8; // above
new DeleteTime = 20;

forward DeletePickup(pickupid);
forward RandomMessage();
forward loadaccount_user(playerid, name[], value[]);
forward DropPlayerWeapons(playerid);

new RandomMessages[][] =
{
    "Menggunakan Program ilegal akan kami BANNED!       /skin(kostum) /vehicle(kendaraan) /weapon(senjata) /anims(gerak)",
    "No SARA No JUNK No SPAWNKILL, Just PLAY AND FUN!   /skin(kostum) /vehicle(kendaraan) /weapon(senjata) /anims(gerak)",
    "Server Ini Masih dalam Keadaan BETA!               /skin(kostum) /vehicle(kendaraan) /weapon(senjata) /anims(gerak)",
    "Dibutuhkan ADMIN Segera, Hub: DheWardhana(OWNER)!  /skin(kostum) /vehicle(kendaraan) /weapon(senjata) /anims(gerak)"
};

main()
{
    print("\n----------------------------------");
    print(" Stepn'One GAMEMODE Script's");
    print(" Weapon System: ADDED!");
    print(" Vehicle System: ADDED!");
    print(" Skin System: ADDED!");
    print(" Animation System: ADDED!");
    print(" Admin System: ADDED!");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    SetNameTagDrawDistance(40.0);
    EnableStuntBonusForAll(0);
    SetWeather(2);
    SetWorldTime(11);

    vehiclelist = LoadModelSelectionMenu("vehicle.txt");
    skinlist = LoadModelSelectionMenu("skins.txt");
    weaponlist = LoadModelSelectionMenu("weapons.txt");

    ShowPlayerMarkers(1);
    ShowNameTags(1);

    SetTimer("RandomMessage",3000,1);
    ShadowsRandom = TextDrawCreate(18.000000,428.000000,"Selamat datang di Step'nOne SAMP                   /skin(kostum) /vehicle(kendaraan) /weapon(senjata) /anims(gerak)");
    TextDrawAlignment(ShadowsRandom,0);
    TextDrawBackgroundColor(ShadowsRandom,0x000000ff);
    TextDrawFont(ShadowsRandom,2);
    TextDrawLetterSize(ShadowsRandom,0.199999,0.899999);
    TextDrawColor(ShadowsRandom,0xffffffff);
    TextDrawSetOutline(ShadowsRandom,1);
    TextDrawSetProportional(ShadowsRandom,1);
    TextDrawSetShadow(ShadowsRandom,1);
    SetGameModeText("STEPNONE GAMEMODE!");

    for(new s = 0; s < 300; s++)
    {
        if(IsInvalidSkin(s)) continue;
        else AddPlayerClass(s, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    }
    return 1;
}

stock IsInvalidSkin(skinid)
{
    #define MAX_BAD_SKINS  15
    if(skinid > 310) return true;
    new badSkins[MAX_BAD_SKINS] = {
        3, 4, 5, 6, 8, 42, 65, 74, 86,
        119, 149, 208, 273, 289, 0
    };
    for (new i = 0; i < MAX_BAD_SKINS; i++)
    {
      if (skinid == badSkins[i]) return true;
    }
    return false;
}

public OnGameModeExit()
{
 	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid,1984.4445,157.9501,55.9384);
    SetPlayerCameraPos(playerid,1984.4445,160.9501,55.9384);
    SetPlayerCameraLookAt(playerid,1984.4445,157.9501,55.9384);
    SetPlayerFacingAngle(playerid,0.0);
    return 1;
}

public OnPlayerConnect(playerid)
{
    WeaponInfo[playerid][Weapon1] = 0;
    WeaponInfo[playerid][Weapon2] = 0;
    WeaponInfo[playerid][Weapon3] = 0;
    WeaponInfo[playerid][Weapon4] = 0;
    WeaponInfo[playerid][Weapon5] = 0;
    WeaponInfo[playerid][Weapon6] = 0;
    WeaponInfo[playerid][Weapon7] = 0;
    WeaponInfo[playerid][Weapon8] = 0;
    WeaponInfo[playerid][Weapon9] = 0;
    WeaponInfo[playerid][Weapon10] = 0;
    WeaponInfo[playerid][Weapon11] = 0;
    WeaponInfo[playerid][Ammo1] = 0;
    WeaponInfo[playerid][Ammo2] = 0;
    WeaponInfo[playerid][Ammo3] = 0;
    WeaponInfo[playerid][Ammo4] = 0;
    WeaponInfo[playerid][Ammo5] = 0;
    WeaponInfo[playerid][Ammo6] = 0;
    WeaponInfo[playerid][Ammo7] = 0;
    WeaponInfo[playerid][Ammo8] = 0;
    WeaponInfo[playerid][Ammo9] = 0;
    WeaponInfo[playerid][Ammo10] = 0;
    WeaponInfo[playerid][Ammo11] = 0;
    WeaponInfo[playerid][Ammo12] = 0;
    
    posX[playerid] = 0.000000, posY[playerid] = 0.000000, posZ[playerid] = 0.000000;
    posA[playerid] = 0.000000, Interior[playerid] = 0, VirtualWorld[playerid] = 0;
    Saved[playerid] = 0;
    new name[MAX_PLAYER_NAME]; //Making a new variable called 'name'. name[MAX_PLAYER_NAME] is created so we can use it to get player's name.
    GetPlayerName(playerid,name,sizeof(name)); //Get player's name
    if(fexist(Path(playerid))) /* Check if the connected user is registered or not. fexist stands for file exist. So if file exist in the files(Path(playerid)),*/
    {// then
        INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid); //Will load user's data using INI_Parsefile.
        ShowPlayerDialog(playerid,login,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nInsert your password to login to your account","Login","Quit");/*A dialog with input style will appear so you can insert your password to login.*/
    }
    else //If the connected user is not registered,
    {//then we will 'force' him to register :)
    	SendClientMessage(playerid, COLOR_BLUE, "Bonus $50000: Untuk pendaftaran pertama, gunakan dengan bijak!");
        ShowPlayerDialog(playerid,register,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.","Register","Quit");
    	GivePlayerMoney(playerid, 50000);
        return 1;
    }
    if(!fexist(pWeaponSave(playerid)))
    {
        new INI:wfile = INI_Open(pWeaponSave(playerid));
                    //  Weapon Create
        INI_WriteInt(wfile, "Weapon1", 0);
        INI_WriteInt(wfile, "Weapon2", 0);
        INI_WriteInt(wfile, "Weapon3", 0);
        INI_WriteInt(wfile, "Weapon4", 0);
        INI_WriteInt(wfile, "Weapon5", 0);
        INI_WriteInt(wfile, "Weapon6", 0);
        INI_WriteInt(wfile, "Weapon7", 0);
        INI_WriteInt(wfile, "Weapon8", 0);
        INI_WriteInt(wfile, "Weapon9", 0);
        INI_WriteInt(wfile, "Weapon10", 0);
        INI_WriteInt(wfile, "Weapon11", 0);
        INI_WriteInt(wfile, "Weapon12", 0);
                    // Ammo Create
        INI_WriteInt(wfile, "Ammo1", 0);
        INI_WriteInt(wfile, "Ammo2", 0);
        INI_WriteInt(wfile, "Ammo3", 0);
        INI_WriteInt(wfile, "Ammo4", 0);
        INI_WriteInt(wfile, "Ammo5", 0);
        INI_WriteInt(wfile, "Ammo6", 0);
        INI_WriteInt(wfile, "Ammo7", 0);
        INI_WriteInt(wfile, "Ammo8", 0);
        INI_WriteInt(wfile, "Ammo9", 0);
        INI_WriteInt(wfile, "Ammo10", 0);
        INI_WriteInt(wfile, "Ammo11", 0);
        INI_WriteInt(wfile, "Ammo12", 0);
        INI_Close(wfile);
        INI_ParseFile(pWeaponSave(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    }
    else if(fexist(pWeaponSave(playerid)))
    {
        INI_ParseFile(pWeaponSave(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    rInfo[playerid][Mute] = 0; rInfo[playerid][Freeze] = 0; rInfo[playerid][Warn] = 0;
    GetPlayerWeaponData(playerid, 1, WeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Ammo1]);
    GetPlayerWeaponData(playerid, 2, WeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Ammo2]);
    GetPlayerWeaponData(playerid, 3, WeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Ammo3]);
    GetPlayerWeaponData(playerid, 4, WeaponInfo[playerid][Weapon4], WeaponInfo[playerid][Ammo4]);
    GetPlayerWeaponData(playerid, 5, WeaponInfo[playerid][Weapon5], WeaponInfo[playerid][Ammo5]);
    GetPlayerWeaponData(playerid, 6, WeaponInfo[playerid][Weapon6], WeaponInfo[playerid][Ammo6]);
    GetPlayerWeaponData(playerid, 7, WeaponInfo[playerid][Weapon7], WeaponInfo[playerid][Ammo7]);
    GetPlayerWeaponData(playerid, 8, WeaponInfo[playerid][Weapon8], WeaponInfo[playerid][Ammo8]);
    GetPlayerWeaponData(playerid, 9, WeaponInfo[playerid][Weapon9], WeaponInfo[playerid][Ammo9]);
    GetPlayerWeaponData(playerid, 10, WeaponInfo[playerid][Weapon10], WeaponInfo[playerid][Ammo10]);
    GetPlayerWeaponData(playerid, 11, WeaponInfo[playerid][Weapon11], WeaponInfo[playerid][Ammo11]);
    GetPlayerWeaponData(playerid, 12, WeaponInfo[playerid][Weapon12], WeaponInfo[playerid][Ammo12]);

    new INI:file = INI_Open(Path(playerid)); //will open their file
    INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
    INI_WriteInt(file,"AdminLevel",pInfo[playerid][Adminlevel]); //If you've set his/her admin level, then his/her admin level will be saved inside of his/her account
    INI_WriteInt(file,"VIPLevel",pInfo[playerid][VIPlevel]);//As explained above
    INI_WriteInt(file,"Money",GetPlayerMoney(playerid));//We will save his money inside of his account
    INI_WriteInt(file,"Scores",GetPlayerScore(playerid));//We will save his score inside of his account
    INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);//As explained above
    INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);//As explained above

    new INI:wfile = INI_Open(pWeaponSave(playerid));
    if(fexist(pWeaponSave(playerid)))
    {
        //      Weapon Save
        INI_WriteInt(wfile, "Weapon1", WeaponInfo[playerid][Weapon1]);
        INI_WriteInt(wfile, "Weapon2", WeaponInfo[playerid][Weapon2]);
        INI_WriteInt(wfile, "Weapon3", WeaponInfo[playerid][Weapon3]);
        INI_WriteInt(wfile, "Weapon4", WeaponInfo[playerid][Weapon4]);
        INI_WriteInt(wfile, "Weapon5", WeaponInfo[playerid][Weapon5]);
        INI_WriteInt(wfile, "Weapon6", WeaponInfo[playerid][Weapon6]);
        INI_WriteInt(wfile, "Weapon7", WeaponInfo[playerid][Weapon7]);
        INI_WriteInt(wfile, "Weapon8", WeaponInfo[playerid][Weapon8]);
        INI_WriteInt(wfile, "Weapon9", WeaponInfo[playerid][Weapon9]);
        INI_WriteInt(wfile, "Weapon10", WeaponInfo[playerid][Weapon10]);
        INI_WriteInt(wfile, "Weapon11", WeaponInfo[playerid][Weapon11]);
        INI_WriteInt(wfile, "Weapon12", WeaponInfo[playerid][Weapon12]);
                    //      Ammo Save
        INI_WriteInt(wfile, "Ammo1", WeaponInfo[playerid][Ammo1]);
        INI_WriteInt(wfile, "Ammo2", WeaponInfo[playerid][Ammo2]);
        INI_WriteInt(wfile, "Ammo3", WeaponInfo[playerid][Ammo3]);
        INI_WriteInt(wfile, "Ammo4", WeaponInfo[playerid][Ammo4]);
        INI_WriteInt(wfile, "Ammo5", WeaponInfo[playerid][Ammo5]);
        INI_WriteInt(wfile, "Ammo6", WeaponInfo[playerid][Ammo6]);
        INI_WriteInt(wfile, "Ammo7", WeaponInfo[playerid][Ammo7]);
        INI_WriteInt(wfile, "Ammo8", WeaponInfo[playerid][Ammo8]);
        INI_WriteInt(wfile, "Ammo9", WeaponInfo[playerid][Ammo9]);
        INI_WriteInt(wfile, "Ammo10", WeaponInfo[playerid][Ammo10]);
        INI_WriteInt(wfile, "Ammo11", WeaponInfo[playerid][Ammo11]);
        INI_WriteInt(wfile, "Ammo12", WeaponInfo[playerid][Ammo12]);
        INI_Close(wfile);
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new PlayerName[MAX_PLAYER_NAME],
    string[128];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), "%s Telah Respawn.", PlayerName);
    SendClientMessageToAll(COLOR_RED, string);
    TextDrawShowForPlayer(playerid, ShadowsRandom);
    GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Ammo1]);
    GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Ammo2]);
    GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Ammo3]);
    GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon4], WeaponInfo[playerid][Ammo4]);
    GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon5], WeaponInfo[playerid][Ammo5]);
    GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon6], WeaponInfo[playerid][Ammo6]);
    GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon7], WeaponInfo[playerid][Ammo7]);
    GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon8], WeaponInfo[playerid][Ammo8]);
    GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon9], WeaponInfo[playerid][Ammo9]);
    GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon10], WeaponInfo[playerid][Ammo10]);
    GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon11], WeaponInfo[playerid][Ammo11]);
    GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon12], WeaponInfo[playerid][Ammo12]);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	DropPlayerWeapons(playerid);
    pInfo[killerid][Kills]++;//Will give 1 kill to killer and it will be saved inside of his/her account
    pInfo[playerid][Deaths]++;
    SendDeathMessage(killerid, playerid, reason);
    return 1;
}

public OnPlayerModelSelection(playerid, response, listid, modelid)
{
    if(listid == vehiclelist)
    {
        if(response)
        {
            SendClientMessage(playerid, 0xFF0000FF, "Kendaraan Muncul!");
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
        }
        else SendClientMessage(playerid, 0xFF0000FF, "Mematalkan Pemilihan Kendaraan");
        return 1;
    }
    if(listid == skinlist)
    {
        if(response)
        {
            SendClientMessage(playerid, 0xFF0000FF, "Skin Terganti!");
            SetPlayerSkin(playerid, modelid);
        }
        else SendClientMessage(playerid, 0xFF0000FF, "Membatalkan Pemilihan Skin");
        return 1;
    }
    if(listid == weaponlist)
    {
        if(modelid==331) //1 knuckle
       {
        if(GetPlayerMoney(playerid) <450) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Brass Knuckles dengan $450");
        GivePlayerMoney(playerid, -450);
        GivePlayerWeapon(playerid, 1, 9999);
       }
        if(modelid==335) //4 pisau
       {
        if(GetPlayerMoney(playerid) <750) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Knife dengan $750");
        GivePlayerMoney(playerid, -750);
        GivePlayerWeapon(playerid, 4, 9999);
       }
        if(modelid==339) //8 katana
       {
        if(GetPlayerMoney(playerid) <1000) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Katana dengan $1000");
        GivePlayerMoney(playerid, -1000);
        GivePlayerWeapon(playerid, 8, 9999);
       }
        if(modelid==346) //22 9mm
       {
        if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Pistol 9mm dengan $3500");
        GivePlayerMoney(playerid, -3500);
        GivePlayerWeapon(playerid, 22, 350);
       }
        if(modelid==347) //23 silenced 9mm
       {
        if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Pistol Silenced 9mm dengan $5000");
        GivePlayerMoney(playerid, -5000);
        GivePlayerWeapon(playerid, 23, 350);
       }
        if(modelid==348) //24 Deagle
       {
        if(GetPlayerMoney(playerid) <8000) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Deagle Pistol dengan $8000");
        GivePlayerMoney(playerid, -8000);
        GivePlayerWeapon(playerid, 24, 200);
       }
        if(modelid==349) //25 Shotgun
       {
        if(GetPlayerMoney(playerid) <6000) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Shotgun dengan $6000");
        GivePlayerMoney(playerid, -6000);
        GivePlayerWeapon(playerid, 25, 80);
       }
        if(modelid==350) //26 Sawnoff Shotgun
       {
        if(GetPlayerMoney(playerid) <8000) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Sawnoff Shotgun dengan $8000");
        GivePlayerMoney(playerid, -8000);
        GivePlayerWeapon(playerid, 26, 80);
       }
        if(modelid==351) //27 auto Shotgun
       {
        if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Combat Shotgun dengan $10000");
        GivePlayerMoney(playerid, -10000);
        GivePlayerWeapon(playerid, 27, 80);
       }
        if(modelid==352)
       {
        if(GetPlayerMoney(playerid) <7500) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Uzi dengan $5000");
        GivePlayerMoney(playerid, -7500);
        GivePlayerWeapon(playerid, 28, 650);
       }
        if(modelid==356)
       {
        if(GetPlayerMoney(playerid) <22500) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli M4 Maverick dengan $22500");
        GivePlayerMoney(playerid, -22500);
        GivePlayerWeapon(playerid, 31, 400);
       }
        if(modelid==357)
       {
        if(GetPlayerMoney(playerid) <15000) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Gun Rifle dengan $15000");
        GivePlayerMoney(playerid, -15000);
        GivePlayerWeapon(playerid, 33, 50);
       }
        if(modelid==358)
       {
        if(GetPlayerMoney(playerid) <17500) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Sniper Rifle dengan $17500");
        GivePlayerMoney(playerid, -17500);
        GivePlayerWeapon(playerid, 34, 40);
       }
        if(modelid==359)
       {
        if(GetPlayerMoney(playerid) <100000) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli RPG dengan $100000");
        GivePlayerMoney(playerid, -100000);
        GivePlayerWeapon(playerid, 35, 10);
       }
        if(modelid==367)
       {
        if(GetPlayerMoney(playerid) <7500) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Canon 1DX dengan $7500");
        GivePlayerMoney(playerid, -7500);
        GivePlayerWeapon(playerid, 43, 1000);
       }
        if(modelid==371)
       {
        if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Parachute dengan $5000");
        GivePlayerMoney(playerid, -6000);
        GivePlayerWeapon(playerid, 46, 1);
   	   }
        if(modelid==1240)
   	   {
        if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Health telah kembali full dengan $1500");
		SetPlayerHealth(playerid, 100);
       }
        if(modelid==1242)
       {
        if(GetPlayerMoney(playerid) <2000) return SendClientMessage(playerid, COLOR_RED, "Uang Anda Tidak Mencukupi!");
        SendClientMessage(playerid, COLOR_BLUE, "Kamu telah membeli Armor dengan $2000");
        SetPlayerArmour(playerid, 100);
       }
     }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[128], pname[MAX_PLAYER_NAME], Float:X, Float:Y, Float:Z, Float:health;
	GetPlayerName(playerid, pname, sizeof(pname));
	switch(dialogid)
	{
		case DIALOG_RCP:
		{
			if(!response) return 0;
			switch(listitem)
			{
				case 0:
				{
					SendClientMessage(playerid, COLOR_YELLOW, "Infinite Health/Armour added!");
					SetPlayerHealth(playerid, 9999999.9);
					SetPlayerArmour(playerid, 9999999.9);
				}
				case 1: ShowPlayerDialog(playerid, DIALOG_KICK, DIALOG_STYLE_INPUT, "Kick:", "Type the id of player you want to kick!", "Kick", "Back");
				case 2: ShowPlayerDialog(playerid, DIALOG_BAN,  DIALOG_STYLE_INPUT, "Ban:",  "Type the id of player you want to ban!", "Ban", "Back");
				case 3: ShowPlayerDialog(playerid, DIALOG_SLAP, DIALOG_STYLE_INPUT, "Slap:", "Type the id of player you want to slap!", "Slap", "Back");
				case 4: ShowPlayerDialog(playerid, DIALOG_EXPLODE, DIALOG_STYLE_INPUT, "Explode", "Type the id of player you want to explode!", "Explode", "Back");
				case 5: ShowPlayerDialog(playerid, DIALOG_AKILL, DIALOG_STYLE_INPUT, "Admin Kill:", "Type the id of player you want to admin-kill!", "AKill", "Back");
				case 6: ShowPlayerDialog(playerid, DIALOG_MUTE, DIALOG_STYLE_INPUT, "Mute:", "Type the id of player you want to mute!", "Mute", "Back");
				case 7: ShowPlayerDialog(playerid, DIALOG_UNMUTE, DIALOG_STYLE_INPUT, "Unmute:", "Type the id of player you want to unmute!", "Unmute", "Back");
				case 8: ShowPlayerDialog(playerid, DIALOG_WARN, DIALOG_STYLE_INPUT, "Warn:", "Type the id of player you want to warn!", "Warn", "Back");
				case 9: ShowPlayerDialog(playerid, DIALOG_UNWARN, DIALOG_STYLE_INPUT, "Unwarn:", "Type the id of player you want to unwarn!", "Unwarn", "Back");
			}
		}
		case DIALOG_KICK:
		{
			if(!response) return ShowPlayerDialog(playerid, DIALOG_RCP, DIALOG_STYLE_LIST, "RCON Control Panel:", "Change Skin\nInfinite Health/Armour\nKick\nBan\nSlap\nExplode\nAdmin Kill\nMute\nUnmute\nFreeze\nUnfreeze\nWarn\nUnwarn", "Choose", "Cancel");
			if(strval(inputtext) == INVALID_PLAYER_ID)
			{
				SendClientMessage(playerid, COLOR_RED, "Player not connected!");
				return 0;
			}
			if(strval(inputtext) == playerid)
			{
				SendClientMessage(playerid, COLOR_RED, "You cannot kick yourself!");
				return 0;
			}
			format(string, sizeof(string), "RCON Admin %s(%d) has kick you!", pname, playerid);
			SendClientMessage(strval(inputtext), COLOR_RED, string);
			format(string, sizeof(string), "You kick playerid %d", strval(inputtext));
			SendClientMessage(playerid, COLOR_RED, string);
			Kick(strval(inputtext));
		}
		case DIALOG_BAN:
		{
			if(!response) return ShowPlayerDialog(playerid, DIALOG_RCP, DIALOG_STYLE_LIST, "RCON Control Panel v1.1 by Reklez:", "Change Skin\nInfinite Health/Armour\nKick\nBan\nSlap\nExplode\nAdmin Kill\nMute\nUnmute\nFreeze\nUnfreeze\nWarn\nUnwarn", "Choose", "Cancel");
			if(strval(inputtext) == INVALID_PLAYER_ID)
			{
				SendClientMessage(playerid, COLOR_RED, "Player not connected!");
				return 0;
			}
			if(strval(inputtext) == playerid)
			{
				SendClientMessage(playerid, COLOR_RED, "You cannot ban yourself!");
				return 0;
			}
			format(string, sizeof(string), "RCON Admin %s(%d) has banned you!", pname, playerid);
			SendClientMessage(strval(inputtext), COLOR_RED, string);
			format(string, sizeof(string), "You banned playerid %d", strval(inputtext));
			SendClientMessage(playerid, COLOR_RED, string);
			Ban(strval(inputtext));
		}
		case DIALOG_SLAP:
		{
			if(!response) return ShowPlayerDialog(playerid, DIALOG_RCP, DIALOG_STYLE_LIST, "RCON Control Panel v1.1 by Reklez:", "Change Skin\nInfinite Health/Armour\nKick\nBan\nSlap\nExplode\nAdmin Kill\nMute\nUnmute\nFreeze\nUnfreeze\nWarn\nUnwarn", "Choose", "Cancel");
			if(strval(inputtext) == INVALID_PLAYER_ID)
			{
				SendClientMessage(playerid, COLOR_RED, "Player not connected!");
				return 0;
			}
			if(strval(inputtext) == playerid)
			{
				SendClientMessage(playerid, COLOR_RED, "You cannot slap yourself!");
				return 0;
			}
			format(string, sizeof(string), "RCON Admin %s(%d) has slap you!", pname, playerid);
			SendClientMessage(strval(inputtext), COLOR_RED, string);
			format(string, sizeof(string), "You slap playerid %d", strval(inputtext));
			SendClientMessage(playerid, COLOR_RED, string);
			GetPlayerPos(strval(inputtext), X, Y, Z);
			GetPlayerHealth(strval(inputtext), health);
		    SetPlayerHealth(strval(inputtext), health-25);
			SetPlayerPos(strval(inputtext), X, Y, Z+5);
            PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0);
            PlayerPlaySound(strval(inputtext), 1190, 0.0, 0.0, 0.0);
		}
		case DIALOG_EXPLODE:
		{
			if(!response) return ShowPlayerDialog(playerid, DIALOG_RCP, DIALOG_STYLE_LIST, "RCON Control Panel v1.1 by Reklez:", "Change Skin\nInfinite Health/Armour\nKick\nBan\nSlap\nExplode\nAdmin Kill\nMute\nUnmute\nFreeze\nUnfreeze\nWarn\nUnwarn", "Choose", "Cancel");
			if(strval(inputtext) == INVALID_PLAYER_ID)
			{
				SendClientMessage(playerid, COLOR_RED, "Player not connected!");
				return 0;
			}
			if(strval(inputtext) == playerid)
			{
				SendClientMessage(playerid, COLOR_RED, "You cannot explode yourself!");
				return 0;
			}
			format(string, sizeof(string), "RCON Admin %s(%d) has explode you!", pname, playerid);
			SendClientMessage(strval(inputtext), COLOR_RED, string);
			format(string, sizeof(string), "You explode playerid %d", strval(inputtext));
			SendClientMessage(playerid, COLOR_RED, string);
			GetPlayerPos(strval(inputtext), X, Y, Z);
			CreateExplosion(X, Y, Z, 7, 1.00);
		}
		case DIALOG_AKILL:
		{
			if(!response) return ShowPlayerDialog(playerid, DIALOG_RCP, DIALOG_STYLE_LIST, "RCON Control Panel v1.1 by Reklez:", "Change Skin\nInfinite Health/Armour\nKick\nBan\nSlap\nExplode\nAdmin Kill\nMute\nUnmute\nFreeze\nUnfreeze\nWarn\nUnwarn", "Choose", "Cancel");
			if(strval(inputtext) == INVALID_PLAYER_ID)
			{
				SendClientMessage(playerid, COLOR_RED, "Player not connected!");
				return 0;
			}
			if(strval(inputtext) == playerid)
			{
				SendClientMessage(playerid, COLOR_RED, "You cannot admin-kill yourself!");
				return 0;
			}
			format(string, sizeof(string), "RCON Admin %s(%d) has admin-kill you!", pname, playerid);
			SendClientMessage(strval(inputtext), COLOR_RED, string);
			format(string, sizeof(string), "You admin-kill playerid %d", strval(inputtext));
			SendClientMessage(playerid, COLOR_RED, string);
			SetPlayerHealth(strval(inputtext), 0.0);
		}
		case DIALOG_MUTE:
		{
			if(!response) return ShowPlayerDialog(playerid, DIALOG_RCP, DIALOG_STYLE_LIST, "RCON Control Panel v1.1 by Reklez:", "Change Skin\nInfinite Health/Armour\nKick\nBan\nSlap\nExplode\nAdmin Kill\nMute\nUnmute\nFreeze\nUnfreeze\nWarn\nUnwarn", "Choose", "Cancel");
			if(strval(inputtext) == INVALID_PLAYER_ID)
			{
				SendClientMessage(playerid, COLOR_RED, "Player not connected!");
				return 0;
			}
			if(strval(inputtext) == playerid)
			{
				SendClientMessage(playerid, COLOR_RED, "You cannot mute yourself!");
				return 0;
			}
			format(string, sizeof(string), "RCON Admin %s(%d) has mute you!", pname, playerid);
			SendClientMessage(strval(inputtext), COLOR_RED, string);
			format(string, sizeof(string), "You mute playerid %d", strval(inputtext));
			SendClientMessage(playerid, COLOR_RED, string);
			rInfo[playerid][Mute] = 1;
		}
		case DIALOG_UNMUTE:
		{
			if(!response) return ShowPlayerDialog(playerid, DIALOG_RCP, DIALOG_STYLE_LIST, "RCON Control Panel v1.1 by Reklez:", "Change Skin\nInfinite Health/Armour\nKick\nBan\nSlap\nExplode\nAdmin Kill\nMute\nUnmute\nFreeze\nUnfreeze\nWarn\nUnwarn", "Choose", "Cancel");
			if(strval(inputtext) == INVALID_PLAYER_ID)
			{
				SendClientMessage(playerid, COLOR_RED, "Player not connected!");
				return 0;
			}
			if(strval(inputtext) == playerid)
			{
				SendClientMessage(playerid, COLOR_RED, "You cannot unmute yourself!");
				return 0;
			}
			format(string, sizeof(string), "RCON Admin %s(%d) has unmute you!", pname, playerid);
			SendClientMessage(strval(inputtext), COLOR_YELLOW, string);
			format(string, sizeof(string), "You unmute playerid %d", strval(inputtext));
			SendClientMessage(playerid, COLOR_YELLOW, string);
			rInfo[playerid][Mute] = 0;
		}
		case DIALOG_WARN:
		{
			if(!response) return ShowPlayerDialog(playerid, DIALOG_RCP, DIALOG_STYLE_LIST, "RCON Control Panel v1.1 by Reklez:", "Change Skin\nInfinite Health/Armour\nKick\nBan\nSlap\nExplode\nAdmin Kill\nMute\nUnmute\nFreeze\nUnfreeze\nWarn\nUnwarn", "Choose", "Cancel");
			if(strval(inputtext) == INVALID_PLAYER_ID)
			{
				SendClientMessage(playerid, COLOR_RED, "Player not connected!");
				return 0;
			}
			if(strval(inputtext) == playerid)
			{
				SendClientMessage(playerid, COLOR_RED, "You cannot warn yourself!");
				return 0;
			}
			if(rInfo[strval(inputtext)][Warn] == 3)
			{
				SendClientMessage(strval(inputtext), COLOR_RED, "You have been kick | Reason: Maxium Warnings!");
				Kick(strval(inputtext));
				return 0;
			}
			format(string, sizeof(string), "RCON Admin %s(%d) has warn you!", pname, playerid);
			SendClientMessage(strval(inputtext), COLOR_RED, string);
			format(string, sizeof(string), "You warn playerid %d", strval(inputtext));
			SendClientMessage(playerid, COLOR_RED, string);
			rInfo[playerid][Warn]++;
		}
		case DIALOG_UNWARN:
		{
			if(!response) return ShowPlayerDialog(playerid, DIALOG_RCP, DIALOG_STYLE_LIST, "RCON Control Panel v1.1 by Reklez:", "Change Skin\nInfinite Health/Armour\nKick\nBan\nSlap\nExplode\nAdmin Kill\nMute\nUnmute\nFreeze\nUnfreeze\nWarn\nUnwarn", "Choose", "Cancel");
			if(strval(inputtext) == INVALID_PLAYER_ID)
			{
				SendClientMessage(playerid, COLOR_RED, "Player not connected!");
				return 0;
			}
			if(strval(inputtext) == playerid)
			{
				SendClientMessage(playerid, COLOR_RED, "You cannot unwarn yourself!");
				return 0;
			}
			if(rInfo[strval(inputtext)][Warn] == 0)
			{
				SendClientMessage(playerid, COLOR_RED, "You cannot unwarn him/her, he/she doesn't have warn yet!");
				return 0;
			}
			format(string, sizeof(string), "RCON Admin %s(%d) has unwarn you!", pname, playerid);
			SendClientMessage(strval(inputtext), COLOR_YELLOW, string);
			format(string, sizeof(string), "You unwarn playerid %d", strval(inputtext));
			SendClientMessage(playerid, COLOR_YELLOW, string);
			rInfo[playerid][Warn]--;
		}
	}
    if(dialogid == register) //If dialog id is a register dialog
    {//then
        if(!response) return Kick(playerid); //If they clicked the second button "Quit", we will kick them.
        if(response) //if they clicked the first button "Register"
        {//then
            if(!strlen(inputtext)) //If they didn't enter any password
            {// then we will tell to them to enter the password to register
                ShowPlayerDialog(playerid,register,DIALOG_STYLE_INPUT,"Mendaftar","Selamat datang! Akun ini belum terdaftar.\nMasukkan Password untuk membuar Akun.\nTolong masukkan password!","Register","Quit");
                return 1;
            }
            //If they have entered a correct password for his/her account...
            new hashpass[129]; //Now we will create a new variable to hash his/her password
            WP_Hash(hashpass,sizeof(hashpass),inputtext);//We will use whirlpool to hash their inputted text
            new INI:file = INI_Open(Path(playerid)); // we will open a new file for them to save their account inside of Scriptfiles/Users folder
            INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
            INI_WriteString(file,"Password",hashpass);//This will write a hashed password into user's account
            INI_WriteInt(file,"AdminLevel",0); //Write an integer inside of user's account called "AdminLevel". We will set his level to 0 after he registered.
            INI_WriteInt(file,"VIPLevel",0);//As explained above
            INI_WriteInt(file,"Money",0);//Write an integer inside of user's account called "Money". We will set their money to 0 after he registered
            INI_WriteInt(file,"Scores",0);//Write an integer inside of user's account called "Scores". We will set their score to 0 after he registered
            INI_WriteInt(file,"Kills",0);//As explained above
            INI_WriteInt(file,"Deaths",0);//As explained above
            INI_Close(file);//Now after we've done saving their data, we now need to close the file
            SendClientMessage(playerid,-1,"Anda sudah terdaftar dengan baik!");//Tell to them that they have successfully registered a new account
            return 1;
        }
    }
    if(dialogid == login) //If dialog id is a login dialog
    {//then
        if(!response) return Kick(playerid); //If they clicked the second button "Quit", we will kick them.
        if(response) //if they clicked the first button "Register"
        {//then
            new hashpass[129]; //Will create a new variable to hash his/her password
            WP_Hash(hashpass,sizeof(hashpass),inputtext); //Will hash inputted password
            if(!strcmp(hashpass, pInfo[playerid][Pass], false)) //If they have insert their correct password
            {//then
                INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);//We will load his account's data from user's path
                SetPlayerScore(playerid,pInfo[playerid][Scores]);//We will get their score inside of his user's account and we will set it here
                GivePlayerMoney(playerid,pInfo[playerid][Money]);//As explained above
                SendClientMessage(playerid,-1,"Selamat datang kembali! kamu telah berhasil masuk!");//Tell them that they've successfully logged in
            }
            else //If they've entered an incorrect password
            {//then
                ShowPlayerDialog(playerid,login,DIALOG_STYLE_INPUT,"Masuk","Selamat datang kembali. Akun ini telah terdaftar. \nMasukkan passwordmu untuk masuk ke akun anda!.\nPassword salah!","Masuk","Keluar");//We will tell to them that they've entered an incorrect password
                return 1;
            }
        }
    }
    return 1;
}

public loadaccount_user(playerid, name[], value[])
{
    INI_String("Password", pInfo[playerid][Pass],129); /*we will use INI_String to load user's password.
    ("Password",.. will load user's password inside of user's path. 'pInfo[playerid][Pass]',...We have defined our user's variable above called, pInfo. Now it's time to use it here to load user's password. '129',... 129 is a length of a hashed user's password. Whirlpool will hash 128 characters + NULL*/
    INI_Int("AdminLevel",pInfo[playerid][Adminlevel]);/*We will use INI_Int to load user's admin level. INI_Int stands for INI_Integer. This load an admin level. */
    INI_Int("VIPLevel",pInfo[playerid][VIPlevel]);//As explained above
    INI_Int("Money",pInfo[playerid][Money]); //As explained above
    INI_Int("Scores",pInfo[playerid][Scores]);//As explained above
    INI_Int("Kills",pInfo[playerid][Kills]);//As explained above
    INI_Int("Deaths",pInfo[playerid][Deaths]);//As explained above
    
    INI_Int("Weapon1", WeaponInfo[playerid][Weapon1]);
    INI_Int("Weapon2", WeaponInfo[playerid][Weapon2]);
    INI_Int("Weapon3", WeaponInfo[playerid][Weapon3]);
    INI_Int("Weapon4", WeaponInfo[playerid][Weapon4]);
    INI_Int("Weapon5", WeaponInfo[playerid][Weapon5]);
    INI_Int("Weapon6", WeaponInfo[playerid][Weapon6]);
    INI_Int("Weapon7", WeaponInfo[playerid][Weapon7]);
    INI_Int("Weapon8", WeaponInfo[playerid][Weapon8]);
    INI_Int("Weapon9", WeaponInfo[playerid][Weapon9]);
    INI_Int("Weapon10", WeaponInfo[playerid][Weapon10]);
    INI_Int("Weapon11", WeaponInfo[playerid][Weapon11]);
    INI_Int("Weapon12", WeaponInfo[playerid][Weapon12]);
        // Load Ammo
    INI_Int("Ammo1", WeaponInfo[playerid][Ammo1]);
    INI_Int("Ammo2", WeaponInfo[playerid][Ammo2]);
    INI_Int("Ammo3", WeaponInfo[playerid][Ammo3]);
    INI_Int("Ammo4", WeaponInfo[playerid][Ammo4]);
    INI_Int("Ammo5", WeaponInfo[playerid][Ammo5]);
    INI_Int("Ammo6", WeaponInfo[playerid][Ammo6]);
    INI_Int("Ammo7", WeaponInfo[playerid][Ammo7]);
    INI_Int("Ammo8", WeaponInfo[playerid][Ammo8]);
    INI_Int("Ammo9", WeaponInfo[playerid][Ammo9]);
    INI_Int("Ammo10", WeaponInfo[playerid][Ammo10]);
    INI_Int("Ammo11", WeaponInfo[playerid][Ammo11]);
    INI_Int("Ammo12", WeaponInfo[playerid][Ammo12]);
    return 1;
}

public DropPlayerWeapons(playerid)
{
    new playerweapons[13][2];
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);//here gets your position..!

    for(new i=0; i<13; i++)
    {
        GetPlayerWeaponData(playerid, i, playerweapons[i][0], playerweapons[i][1]);
        new model = GetWeaponType(playerweapons[i][0]);// this to get, what weapons are you using in the moment !
        new times = floatround(playerweapons[i][1]/10.0001);
        new Float:X = x + (random(3) - random(3));
        new Float:Y = y + (random(3) - random(3));
        if(playerweapons[i][1] != 0 && model != -1)
        {
            if(times > DropLimit) times = DropLimit;
            for(new a=0; a<times; a++)
            {
                new pickupid = CreatePickup(model, 3, X, Y, z);//this is the place where you die, there you will drop your weapons !
                SetTimerEx("DeletePickup", DeleteTime*1000, false, "d", pickupid);//there you may change the time 1 *1000 to *19283718293712 whatever...!
            }
        }
    }
    return 1;
}

public DeletePickup(pickupid)
{
    DestroyPickup(pickupid);
    return 1;
}

public OnPlayerText(playerid, text[])
{
	if(rInfo[playerid][Mute] == 1)
	{
		SendClientMessage(playerid, COLOR_RED, "You cannot talk you are mute!");
		return 0;
	}
	return 1;
}

public OnPlayerUpdate(playerid)
{
    SetPlayerScore(playerid, GetPlayerMoney(playerid));
	return 1;
}

//Stock Functions
stock Path(playerid) //Will create a new stock so we can easily use it later to load/save user's data in user's path
{
    new str[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(str,sizeof(str),UserPath,name);
    return str;
}

stock NoMinus(string[])
{
    for(new i; i < strlen(string); i++)
    {
        if(string[i] == '-')
        {
            strdel(string, i, i+1);
        }
    }
    return string;
}

stock pWeaponSave(playerid)
{
    new string[50];
    format(string, sizeof(string), PATH, GetName(playerid));
    return string;
}


stock GetName(playerid)
{
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}

public RandomMessage()
{
        TextDrawSetString(ShadowsRandom, RandomMessages[random(sizeof(RandomMessages))]);
        return 1;
}

GetWeaponType(weaponid) //explainin'
{
    switch(weaponid)
    {
        case 1: return 331; case 2: return 333; case 3: return 334; // this is to define the weapons
        case 4: return 335; case 5: return 336; case 6: return 337;
        case 7: return 338; case 8: return 339; case 9: return 341;
        case 10: return 321; case 11: return 322; case 12: return 323;
        case 13: return 324; case 14: return 325; case 15: return 326;
        case 16: return 342; case 17: return 343; case 18: return 344;
        case 22: return 346; case 23: return 347; case 24: return 348;
        case 25: return 349; case 26: return 350; case 27: return 351;
        case 28: return 352; case 29: return 353; case 30: return 355;
        case 31: return 356; case 32: return 372; case 33: return 357;
        case 34: return 358; case 35: return 359; case 36: return 360;
        case 37: return 361; case 38: return 362; case 39: return 363;
        case 41: return 365; case 42: return 366; case 46: return 371; //example, this case is the id 46 is the parachute, we will drop the parachute, that's if  you got one
    }
    return -1;
}

//Commands
CMD:weapon(playerid, params[])
{
    ShowModelSelectionMenu(playerid, weaponlist, "Weapon:");
    return 1;
}

CMD:vehicle(playerid, params[])
{
    ShowModelSelectionMenu(playerid, vehiclelist, "Vehicle:");
    return 1;
}

CMD:skin(playerid, params[])
{
    ShowModelSelectionMenu(playerid, skinlist, "Select Skin:");
    return 1;
}

CMD:kill(playerid, params[])
{
    SetPlayerHealth(playerid, 0);
    return 1;
}

CMD:s(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        GetVehiclePos(vehicleid, posX[playerid], posY[playerid], posZ[playerid]);
        GetVehicleZAngle(vehicleid, posA[playerid]);
    }
    else
    {
        GetPlayerPos(playerid, posX[playerid], posY[playerid], posZ[playerid]);
        GetPlayerFacingAngle(playerid, posA[playerid]);
    }
    Interior[playerid] = GetPlayerInterior(playerid);
    VirtualWorld[playerid] = GetPlayerVirtualWorld(playerid);
    SendClientMessage(playerid, -1, "Kamu telah menyimpan posisimu");
    SendClientMessage(playerid, -1, "Gunakan /r, /loadpos Untuk memuat posisi yang disimpan!");
    Saved[playerid] = 1;
    return 1;
}

CMD:savepos(playerid, params[])
{
    return cmd_s(playerid, params);
}


CMD:r(playerid, params[])
{
    if(Saved[playerid] == 1)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            SetVehiclePos(vehicleid, posX[playerid], posY[playerid], posZ[playerid]);
            SetVehicleZAngle(vehicleid, posA[playerid]);
            LinkVehicleToInterior(vehicleid, Interior[playerid]);
            SetVehicleVirtualWorld(vehicleid, VirtualWorld[playerid]);
        }
        else
        {
            SetPlayerPos(playerid, posX[playerid], posY[playerid], posZ[playerid]);
            SetPlayerFacingAngle(playerid, posA[playerid]);
            SetPlayerInterior(playerid, Interior[playerid]);
            SetPlayerVirtualWorld(playerid, VirtualWorld[playerid]);
        }
        SendClientMessage(playerid, -1, "Kamu telah memuat posisimu");
        SendClientMessage(playerid, -1, "Gunakan /s, /savepos Untuk menyimpan posisi yang disimpan!");
    }
    else
    {
        SendClientMessage(playerid, -1, "ERROR: Kamu belum pernah menyimpan posisi sebelumnya!");
        SendClientMessage(playerid, -1, "Gunakan /s, /savepos Untuk menyimpan posisi yang disimpan");
    }
    return 1;
}

CMD:loadpos(playerid, params[])
{
    return cmd_r(playerid, params);
}

CMD:v(playerid, params[])
{
    return cmd_vehicle(playerid, params);
}

CMD:w(playerid, params[])
{
    return cmd_weapon(playerid, params);
}

CMD:goto(playerid, params[])
{
    new targetid, string[128];
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/goto [PlayerID/Nama]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Pemain tidak Online");
    else
    {
        new pName[24];
        GetPlayerName(targetid,pName,128);
        format(string, sizeof(string), "Anda Telah di Teleportasi ke [%d], %s Sudah Sampai.",targetid, pName);
        SendClientMessage(playerid,-1,string);
        SetPlayerInterior(playerid,GetPlayerInterior(targetid));
        new Float:TeleX, Float:TeleY, Float:TeleZ;
        GetPlayerPos(targetid, TeleX, TeleY, TeleZ);
        SetPlayerPos(playerid, TeleX, TeleY, TeleZ+1);
    }
    return 1;
}

CMD:adminmenu(playerid, params[])
{
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You are not RCON Admin, you cannot activate RCON Control Panel!");
	ShowPlayerDialog(playerid, DIALOG_RCP, DIALOG_STYLE_LIST, "RCON Control Panel v1.1 by Reklez:", "Infinite Health/Armour\nKick\nBan\nSlap\nExplode\nAdmin Kill\nMute\nUnmute\nWarn\nUnwarn", "Choose", "Cancel");
	return 1;
}

CMD:relax(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0);
	}
    return 1;
}

CMD:handsup(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
	}
    return 1;
}

CMD:bomb(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
	}
    return 1;
}

CMD:robman(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0);
	}
    return 1;
}

CMD:crossarms(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"PAULNMAC", "wank_loop", 1.800001, 1, 0, 0, 1, 600);
	}
    return 1;
}

CMD:taichi(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"PARK","Tai_Chi_Loop",4.0,1,0,0,0,0);
	}
    return 1;
}

CMD:spank(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0);
	}
    return 1;
}

CMD:wave(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0);
	}
    return 1;
}

CMD:sick(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0);
	}
    return 1;
}

CMD:scared(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0);
	}
    return 1;
}

CMD:talk(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"PED","IDLE_CHAT",1.800001, 1, 1, 1, 1, 13000);
	}
    return 1;
}

CMD:kiss(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"KISSING", "Grlfrd_Kiss_02", 1.800001, 1, 0, 0, 1, 600);
	}
    return 1;
}

CMD:sit(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"INT_OFFICE", "OFF_Sit_Bored_Loop", 1.800001, 1, 0, 0, 1, 600);
	}
    return 1;
}

CMD:fucku(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"ped", "fucku", 4.1, 0, 1, 1, 1, 1 );
	}
    return 1;
}

CMD:cocaine(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"CRACK", "crckdeth2", 1.800001, 1, 0, 0, 1, 600);
	}
    return 1;
}

CMD:rocky(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"GYMNASIUM", "GYMshadowbox", 1.800001, 1, 0, 0, 1, 600);
	}
    return 1;
}

CMD:smoke(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0);
	}
    return 1;
}

CMD:beach(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"BEACH","SitnWait_loop_W",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:lookout(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"ON_LOOKERS","lkup_in",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:circle(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"CHAINSAW","CSAW_Hit_2",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:medic(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"MEDIC","CPR",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:chat(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:die(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"PED","BIKE_fallR",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:slapa(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"PED","BIKE_elbowL",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:rofl(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"PED","Crouch_Roll_L",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:glitched(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"TATTOOS","TAT_Sit_Out_O",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:fakefire(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        ApplyAnimation(playerid,"SILENCED","SilenceCrouchfire",4.1,0,1,1,1,1);
	}
    return 1;
}
CMD:fart(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
        PlayerPlaySound(playerid, 1147, 0.0, 0.0, 0.0);
	}
    return 1;
}

CMD:vomit(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
            ApplyAnimation(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0);
            PlayerPlaySound(playerid, 1169, 0.0, 0.0, 0.0);
	}
    return 1;
}

CMD:drunk(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
		    ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,0,1,1,1,1);
		    ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,0,1,1,1,1);
		    ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:getin(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
		    ApplyAnimation(playerid,"NEVADA","NEVADA_getin",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:piss(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
		    SetPlayerSpecialAction(playerid, 68);
	}
    return 1;
}

CMD:funnywalk(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
		    ApplyAnimation(playerid,"WUZI","Wuzi_Walk",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:kickass(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
		    ApplyAnimation(playerid,"FIGHT_E","Hit_fightkick",4.1,0,1,1,1,1);
	}
    return 1;
}

CMD:cell(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
		    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
	}
    return 1;
}

CMD:laugh(playerid, params[])
{
    if (GetPlayerState(playerid)== 1)
	{
		    ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0);
	}
    return 1;
}

CMD:eat(playerid, params[])
{
    ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
    return 1;
}

CMD:injured(playerid, params[])
{
    ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 0, 0);
    return 1;
}

CMD:slapass(playerid, params[])
{
    ApplyAnimation(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0);
    return 1;
}

CMD:laydown(playerid, params[])
{
    ApplyAnimation(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0);
    return 1;
}

CMD:arrest(playerid, params[])
{
    ApplyAnimation(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1);
    return 1;
}

CMD:carjack(playerid, params[])
{
    ApplyAnimation(playerid,"PED","CAR_jackedLHS",4.0,0,1,1,1,0);
    return 1;
}

CMD:animsoff(playerid, params[])
{
    ClearAnimations(playerid);
    return 1;
}

CMD:anims(playerid, params[])
{
    new string[1024];
    strcat(string, "{9F9F9F}" "/relax | /scared | /sick | /wave | /spank | /taichi | /crossarms |\n", 1024);
    strcat(string, "{FFA200}" "/wank | /kiss | /talk | /fucku | /cocaine | /rocky | /sit | /smoke |\n", 1024);
    strcat(string, "{9F9F9F}" "/beach | /lookout | /circle | /medic | /chat | /die | /slapa | /rofl |\n", 1024);
    strcat(string, "{FFA200}" "/glitched | /fakefire | /bomb | /robman | /handsup | /piss |\n", 1024);
    strcat(string, "{9F9F9F}" "/getin | /skate | /cover | /fart | /vomit | /drunk |\n", 1024);
    strcat(string, "{FFA200}" "/funnywalk | /kickass | /cell | /laugh | /eat | /injured |\n", 1024);
    strcat(string, "{9F9F9F}" "/slapass | /laydown | /arrest | /laugh | /eat | /carjack  |", 1024);
    ShowPlayerDialog(playerid,DIALOG_ANIMS,DIALOG_STYLE_MSGBOX,"{9F9F9F}" "Animations", string, "OKAY!", "");
    return 1;
}
Full gm script: http://pastebin.com/9DGdA6sH
Reply
#2

help please
Reply
#3

PROBLEM FIXED!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)