Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward CaseOpen(playerid);
- public CaseOpen(playerid)
- {
- new rand = random(100),string[256],strings[128],strz[64];
- if(rand == 1)
- {
- if(CaseCount[playerid] == 0)
- {
- if(PlayerInfo[playerid][pPremiumAccount] != 2) {
- PlayerInfo[playerid][pPremiumAccount] = 2;
- Update(playerid, pPremiumAccountx);
- format(strings,sizeof strings,"* You win a vip account.");
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1277); //disket vip account
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "vip account");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- { //1 - red | 2 - green | 3 - yellow | 4- pink | 5- blue
- new randneon = 1 + random(5),neontext[16],neon;
- if(randneon == 1)
- {
- neon = 18647;
- format(neontext,sizeof(neontext), "red");
- PlayerInfo[playerid][pNeonR]++;
- Update(playerid, pNeonRx);
- }
- else if(randneon == 2)
- {
- neon = 18649;
- format(neontext,sizeof(neontext), "green");
- PlayerInfo[playerid][pNeonV]++;
- Update(playerid, pNeonVx);
- }
- else if(randneon == 3)
- {
- neon = 18650;
- format(neontext,sizeof(neontext), "yellow");
- PlayerInfo[playerid][pNeonG]++;
- Update(playerid, pNeonGx);
- }
- else if(randneon == 4)
- {
- neon = 18651;
- format(neontext,sizeof(neontext), "pink");
- PlayerInfo[playerid][pNeonRZ]++;
- Update(playerid, pNeonRZx);
- }
- else if(randneon == 5)
- {
- neon = 18648;
- format(neontext,sizeof(neontext), "blue");
- PlayerInfo[playerid][pNeonA]++;
- Update(playerid, pNeonAx);
- }
- format(strings,sizeof strings,"* You win a %s neon (/myneons).",neontext);
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], neon);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "%s neon",neontext);
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- mysql_format(SQL, string, sizeof(string), "INSERT INTO opencase_logs (`text`,`PlayerID`) VALUES ('%s','%d')", strings, PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL,string,"","");
- }
- else {
- if(PlayerInfo[playerid][pPremiumAccount] != 2) {
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1277); //disket vip account
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "vip account");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- //1 - red | 2 - green | 3 - yellow | 4- pink | 5- blue
- new randneon = 1 + random(5),neontext[16],neon;
- if(randneon == 1)
- {
- neon = 18647;
- format(neontext,sizeof(neontext), "red");
- }
- else if(randneon == 2)
- {
- neon = 18649;
- format(neontext,sizeof(neontext), "green");
- }
- else if(randneon == 3)
- {
- neon = 18650;
- format(neontext,sizeof(neontext), "yellow");
- }
- else if(randneon == 4)
- {
- neon = 18651;
- format(neontext,sizeof(neontext), "pink");
- }
- else if(randneon == 5)
- {
- neon = 18648;
- format(neontext,sizeof(neontext), "blue");
- }
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], neon);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "%s neon",neontext);
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- }
- }
- else if(rand == 0)
- {
- if(CaseCount[playerid] == 0)
- {
- if(PlayerInfo[playerid][pPremiumAccount] == 0) {
- PlayerInfo[playerid][pPremiumAccount] = 1;
- Update(playerid, pPremiumAccountx);
- format(strings,sizeof strings,"* You win a premium account.");
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1277); //disket premium account
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "premium account");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- //1 - red | 2 - green | 3 - yellow | 4- pink | 5- blue
- new randneon = 1 + random(5),neontext[16],neon;
- if(randneon == 1)
- {
- neon = 18647;
- format(neontext,sizeof(neontext), "red");
- PlayerInfo[playerid][pNeonR]++;
- Update(playerid, pNeonRx);
- }
- else if(randneon == 2)
- {
- neon = 18649;
- format(neontext,sizeof(neontext), "green");
- PlayerInfo[playerid][pNeonV]++;
- Update(playerid, pNeonVx);
- }
- else if(randneon == 3)
- {
- neon = 18650;
- format(neontext,sizeof(neontext), "yellow");
- PlayerInfo[playerid][pNeonG]++;
- Update(playerid, pNeonGx);
- }
- else if(randneon == 4)
- {
- neon = 18651;
- format(neontext,sizeof(neontext), "pink");
- PlayerInfo[playerid][pNeonRZ]++;
- Update(playerid, pNeonRZx);
- }
- else if(randneon == 5)
- {
- neon = 18648;
- format(neontext,sizeof(neontext), "blue");
- PlayerInfo[playerid][pNeonA]++;
- Update(playerid, pNeonAx);
- }
- format(strings,sizeof strings,"* You win a %s neon (/myneons).",neontext);
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], neon);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "%s neon",neontext);
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- mysql_format(SQL, string, sizeof(string), "INSERT INTO opencase_logs (`text`,`PlayerID`) VALUES ('%s','%d')", strings, PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL,string,"","");
- }
- else
- {
- if(PlayerInfo[playerid][pPremiumAccount] == 0) {
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1277); //disket vip account
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "premium account");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- //1 - red | 2 - green | 3 - yellow | 4- pink | 5- blue
- new randneon = 1 + random(5),neontext[16],neon;
- if(randneon == 1)
- {
- neon = 18647;
- format(neontext,sizeof(neontext), "red");
- }
- else if(randneon == 2)
- {
- neon = 18649;
- format(neontext,sizeof(neontext), "green");
- }
- else if(randneon == 3)
- {
- neon = 18650;
- format(neontext,sizeof(neontext), "yellow");
- }
- else if(randneon == 4)
- {
- neon = 18651;
- format(neontext,sizeof(neontext), "pink");
- }
- else if(randneon == 5)
- {
- neon = 18648;
- format(neontext,sizeof(neontext), "blue");
- }
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], neon);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "%s neon",neontext);
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- }
- }
- else if(rand >= 2 && rand <= 7)
- {
- if(CaseCount[playerid] == 0)
- {
- PlayerInfo[playerid][pLevel]++;
- Update(playerid, pLevelx);
- SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
- format(strings,sizeof strings,"* You win a level up.");
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- mysql_format(SQL, string, sizeof(string), "INSERT INTO opencase_logs (`text`,`PlayerID`) VALUES ('%s','%d')", strings, PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL,string,"","");
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1851); //levelup
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "level up");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1851); //levelup
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "level up");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- }
- else if(rand >= 8 && rand <= 13)
- {
- if(CaseCount[playerid] == 0)
- {
- PlayerInfo[playerid][pPremiumPoints] += 20;
- Update(playerid, pPremiumPointsx);
- format(strings,sizeof strings,"* You win 20 premium points.");
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- mysql_format(SQL, string, sizeof(string), "INSERT INTO opencase_logs (`text`,`PlayerID`) VALUES ('%s','%d')", strings, PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL,string,"","");
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1882); //premiumpoints
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "20 premium points");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1882); //premiumpoints
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "20 premium points");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- }
- else if(rand >= 14 && rand <= 25)
- {
- if(CaseCount[playerid] == 0)
- {
- if(PlayerInfo[playerid][pTSkins] < 311)
- {
- new randskin = random(312);
- while(verifySkin(playerid, randskin) == 1 || randskin == 74) randskin = random(312);
- addSkin(playerid, randskin);
- format(strings,sizeof strings,"* You win skin %d.",randskin);
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], randskin); //skin
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "skin %d",randskin);
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- GivePlayerCash(playerid,800000);
- format(strings,sizeof strings,"* You win 800,000$.");
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1550); //money
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "800.000$");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- mysql_format(SQL, string, sizeof(string), "INSERT INTO opencase_logs (`text`,`PlayerID`) VALUES ('%s','%d')", strings, PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL,string,"","");
- }
- else
- {
- if(PlayerInfo[playerid][pTSkins] < 311)
- {
- new randskin = random(312);
- while(verifySkin(playerid, randskin) == 1 || randskin == 74) randskin = random(312);
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], randskin); //skin
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "skin %d",randskin);
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1550); //money
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "800.000$");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- }
- }
- if(rand >= 26 && rand <= 40)
- {
- if(CaseCount[playerid] == 0)
- {
- if(PlayerInfo[playerid][pPet] != 0)
- {
- PlayerInfo[playerid][pPetPoints] += 50;
- Update(playerid, pPetPointsx);
- format(strings,sizeof strings,"* You win 50 pet points.");
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 19079); //pet points
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "50 pet points");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- GivePlayerCash(playerid,400000);
- format(strings,sizeof strings,"* You win 400,000$.");
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1550); //money
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "400.000$");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- mysql_format(SQL, string, sizeof(string), "INSERT INTO opencase_logs (`text`,`PlayerID`) VALUES ('%s','%d')", strings, PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL,string,"","");
- }
- else {
- if(PlayerInfo[playerid][pPet] != 0)
- {
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 19079); //pet points
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "50 pet points");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1550); //money
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "400.000$");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- }
- }
- else if(rand >= 41 && rand <= 55)
- {
- if(CaseCount[playerid] == 0)
- {
- PlayerInfo[playerid][pGiftTime] += 100;
- Update(playerid, pGiftTimex);
- format(strings,sizeof strings,"* You win 100 gift points.");
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- mysql_format(SQL, string, sizeof(string), "INSERT INTO opencase_logs (`text`,`PlayerID`) VALUES ('%s','%d')", strings, PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL,string,"","");
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 19054); //gift points
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "100 gift points");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 19054); //gift points
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "100 gift points");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- }
- else if(rand >= 56 && rand <= 66)
- {
- if(CaseCount[playerid] == 0)
- {
- PlayerInfo[playerid][pExp] += 10;
- Update(playerid, pExpx);
- format(strings,sizeof strings,"* You win 10 respect points.");
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- mysql_format(SQL, string, sizeof(string), "INSERT INTO opencase_logs (`text`,`PlayerID`) VALUES ('%s','%d')", strings, PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL,string,"","");
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 2614); //respect points
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "10 respect points");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 2614); //respect points
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "10 respect points");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- }
- else if(rand >= 67 && rand <= 85)
- {
- if(CaseCount[playerid] == 0)
- {
- GivePlayerCash(playerid,200000);
- format(strings,sizeof strings,"* You win 200,000$.");
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- mysql_format(SQL, string, sizeof(string), "INSERT INTO opencase_logs (`text`,`PlayerID`) VALUES ('%s','%d')", strings, PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL,string,"","");
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1550); //money
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "200.000$");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1550); //money
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "200.000$");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- }
- else if(rand >= 86 && rand <= 100)
- {
- if(CaseCount[playerid] == 0)
- {
- GivePlayerCash(playerid,150000);
- format(strings,sizeof strings,"* You win 150,000$.");
- SendClientMessage(playerid,COLOR_YELLOW,strings);
- mysql_format(SQL, string, sizeof(string), "INSERT INTO opencase_logs (`text`,`PlayerID`) VALUES ('%s','%d')", strings, PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL,string,"","");
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1550); //money
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "150.000$");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- else
- {
- PlayerTextDrawSetPreviewModel(playerid, OpencaseTD[playerid][7], 1550); //money
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][7]);
- format(strz, sizeof(strz), "150.000$");
- PlayerTextDrawSetString(playerid, OpencaseTD[playerid][8], strz);
- PlayerTextDrawShow(playerid, OpencaseTD[playerid][8]);
- }
- }
- if(CaseCount[playerid] > 0)
- {
- if(CaseCount[playerid] >= 10) opencasetimer[playerid] = SetTimerEx("CaseOpen",500, false, "i", playerid);
- else if(CaseCount[playerid] >= 5) opencasetimer[playerid] = SetTimerEx("CaseOpen",1000, false, "i", playerid);
- else opencasetimer[playerid] = SetTimerEx("CaseOpen",1500, false, "i", playerid);
- }
- if(CaseCount[playerid] >= 1) CaseCount[playerid]--;
- else
- {
- PlayerInfo[playerid][pCases]--;
- Update(playerid,pCasesx);
- CaseOpening[playerid] = 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment