Jump to content
  • 0

Ajutor Temp Vip


SkyLeAs

Question

Problema intalnita ( descriere ):Salut vreau sa fac la buy vip ca cele 5 level-uri sa fie pe zile adika 20 de zile si 15 zile dar nush cum
Ero( area / rile ) / warning -( ul / urile ):-
Liniile de cod / sursa / script - ul :

	case BuyVip3:
	    {
	        if ( !response )
				return ( 1 );

			gsString[ 0 ] = EOS;
	        strcat( gsString, "{FF0000}• {00FF00}VIP Level 1 {FF0000}» {FF8000}Free!n
						       {FF0000}• {00FF00}VIP Level 2{FF0000}» {FF8000}8 Hours and 200 Coinsn
						       {FF0000}• {00FF00}VIP Level 3{FF0000}» {FF8000}12 Hours and 300 Coinsn
						       {FF0000}• {00FF00}VIP Level 4{FF0000}» {FF8000}16 Hours and 400 Coinsn" );
			strcat( gsString, "{FF0000}• {00FF00}VIP Level 5 {FF0000}» {FF8000}20 Hours and 600 Coinsn
							   {FF0000}• {00FF00}VIP Level 6{FF0000}» {FF8000}25 Hours and 1000 Coinsn
						       {FF0000}• {00FF00}VIP Level 7{FF0000}» {FF8000}30 Hours and 1500 Coinsn
							   {FF0000}• {00FF00}VIP Level 8{FF0000}» {FF8000}35 Hours and 2000 Coinsn" );
			strcat( gsString, "{FF0000}• {00FF00}VIP Level 9{FF0000}» {FF8000}40 Hours and 2500 Coinsn
						       {FF0000}• {00FF00}VIP Level 10{FF0000}» {FF8000}50 Hours and 4000 Coinsn" );
	        ShowPlayerDialog( playerid, BuyVip5, 2, "Buy VIP - Select level", gsString, "Buy", "Exit" );
	    }
case BuyVip5:
	    {
	        if ( !response )
				return ( 1 );

	        switch( listitem )
	        {
	            case 0:
	            {

					PlayerInfo[ playerid ][ pVip ]   = 1;
	                Info( playerid, "~y~~h~INFO:~n~~w~~h~You have just bought VIP Level 1!!!", 5000 );
	                return ( 1 );
	            }
	            case 1:
	            {
	                if ( PlayerInfo[ playerid ][ Coins ] < 200 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~coins~w~~h~ to buy this option !" );

					if ( PlayerInfo[ playerid ][ hours ] < 8 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~hours~w~~h~ to buy this option !" );

					PlayerInfo[ playerid ][ pVip ] = 2;
	                PlayerInfo[ playerid ][ hours ] -= 8;
	                PlayerInfo[ playerid ][ Coins ] -= 200;
	                Info( playerid, "~y~~h~INFO:~n~~w~~h~You have just bought VIP Level 3 for ~r~~h~3.000 ~w~~h~coins and ~r~~h~30 ~w~~h~hours!!!", 5000 );
	                return ( 1 );
	            }
	            case 2:
	            {
	                if ( PlayerInfo[ playerid ][ Coins ] < 300 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~coins~w~~h~ to buy this option !" );

					if ( PlayerInfo[ playerid ][ hours ] < 12 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~hours~w~~h~ to buy this option !" );

					PlayerInfo[ playerid ][ pVip ] = 3;
	                PlayerInfo[ playerid ][ hours ] -= 12;
	                PlayerInfo[ playerid ][ Coins ] -= 300;
	                Info( playerid, "~y~~h~INFO:~n~~w~~h~You have just bought VIP Level 3 for ~r~~h~3.000 ~w~~h~coins and ~r~~h~30 ~w~~h~hours!!!", 5000 );
	                return ( 1 );
	            }
	            case 3:
	            {
	                if ( PlayerInfo[ playerid ][ Coins ] < 400 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~coins~w~~h~ to buy this option !" );

					if ( PlayerInfo[ playerid ][ hours ] < 16 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~hours~w~~h~ to buy this option !" );

					PlayerInfo[ playerid ][ pVip ] = 4;
	                PlayerInfo[ playerid ][ hours ] -= 16;
	                PlayerInfo[ playerid ][ Coins ] -= 400;
	                Info( playerid, "~y~~h~INFO:~n~~w~~h~You have just bought VIP Level 4 for ~r~~h~5.000 ~w~~h~coins and ~r~~h~60 ~w~~h~hours!!!", 5000 );
	                return ( 1 );
	            }
	            case 4:
	            {
	                if ( PlayerInfo[ playerid ][ Coins ] < 600 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~coins~w~~h~ to buy this option !" );

					if ( PlayerInfo[ playerid ][ hours ] < 20 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~hours~w~~h~ to buy this option !" );

					PlayerInfo[ playerid ][ pVip ] = 5;
	                PlayerInfo[ playerid ][ hours ] -= 20;
	                PlayerInfo[ playerid ][ Coins ] -= 600;
	                Info( playerid, "~y~~h~INFO:~n~~w~~h~You have just bought VIP Level 5 for ~r~~h~7.000 ~w~~h~coins and ~r~~h~80 ~w~~h~hours!!!", 5000 );
	                return ( 1 );
	            }
	            case 5:
	            {
	                if ( PlayerInfo[ playerid ][ Coins ] < 100 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~coins~w~~h~ to buy this option !" );

					if ( PlayerInfo[ playerid ][ hours ] < 100 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~hours~w~~h~ to buy this option !" );

					PlayerInfo[ playerid ][ pVip ] = 6;
	                PlayerInfo[ playerid ][ hours ] -= 25;
	                PlayerInfo[ playerid ][ Coins ] -= 100;
	                Info( playerid, "~y~~h~INFO:~n~~w~~h~You have just bought VIP Level 6 for ~r~~h~9.000 ~w~~h~coins and ~r~~h~100 ~w~~h~hours!!!", 5000 );
	                return ( 1 );
	            }
	            case 6:
	            {
	                if ( PlayerInfo[ playerid ][ Coins ] < 1500 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~coins~w~~h~ to buy this option !" );

					if ( PlayerInfo[ playerid ][ hours ] < 30 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~hours~w~~h~ to buy this option !" );

					PlayerInfo[ playerid ][ pVip ] = 7;
	                PlayerInfo[ playerid ][ hours ] -= 30;
	                PlayerInfo[ playerid ][ Coins ] -= 1500;
	                Info( playerid, "~y~~h~INFO:~n~~w~~h~You have just bought VIP Level 7 for ~r~~h~10.000 ~w~~h~coins and ~r~~h~120 ~w~~h~hours!!!", 5000 );
	                return ( 1 );
	            }
	            case 7:
	            {
	                if ( PlayerInfo[ playerid ][ Coins ] < 2000 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~coins~w~~h~ to buy this option !" );

					if ( PlayerInfo[ playerid ][ hours ] < 140 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~hours~w~~h~ to buy this option !" );

					PlayerInfo[ playerid ][ pVip ] = 8;
	                PlayerInfo[ playerid ][ hours ] -= 35;
	                PlayerInfo[ playerid ][ Coins ] -= 2000;
	                Info( playerid, "~y~~h~INFO:~n~~w~~h~You have just bought VIP Level 8 for ~r~~h~10.000 ~w~~h~coins and ~r~~h~140 ~w~~h~hours!!!", 5000 );
	                return ( 1 );
	            }
	            case 8:
	            {
	                if ( PlayerInfo[ playerid ][ Coins ] < 40 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~coins~w~~h~ to buy this option !" );

					if ( PlayerInfo[ playerid ][ hours ] < 150 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~hours~w~~h~ to buy this option !" );

					PlayerInfo[ playerid ][ pVip ] = 9;
	                PlayerInfo[ playerid ][ hours ] -= 40;
	                PlayerInfo[ playerid ][ Coins ] -= 2500;
	                Info( playerid, "~y~~h~INFO:~n~~w~~h~You have just bought VIP Level 9 for ~r~~h~11.500 ~w~~h~coins and ~r~~h~150 ~w~~h~hours!!!", 5000 );
	                return ( 1 );
	            }
	            case 9:
	            {
	                if ( PlayerInfo[ playerid ][ Coins ] < 50 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~coins~w~~h~ to buy this option !" );

					if ( PlayerInfo[ playerid ][ hours ] < 4000 )
						return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~hours~w~~h~ to buy this option !" );

					PlayerInfo[ playerid ][ pVip ] = 10;
	                PlayerInfo[ playerid ][ hours ] -= 50;
	                PlayerInfo[ playerid ][ Coins ] -= 4000;
	                Info( playerid, "~y~~h~INFO:~n~~w~~h~You have just bought VIP Level 10 for ~r~~h~20.000 ~w~~h~coins and ~r~~h~150 ~w~~h~hours!!!", 5000 );
	                return ( 1 );
	            }
	        }
	        return ( 1 );
	    }

Imagini / Video ( optional ):Nu cred ca este nevoie
Ati incercat sa rezolvati singur ?:Da am incercat dupa http://forum.sa-mp.com/showthread.php?t=254915dar nu am reusit.
Ma poate ajuta cineva

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

Eu iti dau doar pentru ultimu model,iar dupa ala te iei tu...

forward scoatevip();
public scoatevip();
{
SendClientMessageToAll(playerid, COLOR_RED, "%s a ramas fara VIP.Motiv:I s-a scurs termenul.", giveplayer);;
PlayerInfo[ playerid ][ pVip ] = 0;
}
case 9:
     {
     if ( PlayerInfo[ playerid ][ Coins ] < 50 )
                        return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~coins~w~~h~ to buy this option !" );

                    if ( PlayerInfo[ playerid ][ hours ] < 4000 )
                        return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~hours~w~~h~ to buy this option !" );

                    PlayerInfo[ playerid ][ pVip ] = 10;
     PlayerInfo[ playerid ][ hours ] -= 50;
     PlayerInfo[ playerid ][ Coins ] -= 4000;
     SetTimer("scoatevip", 604800, false);// 604800 inseamna timpu in milisecunde. *7 zile*
     Info( playerid, "~y~~h~INFO:~n~~w~~h~You have just bought VIP Level 10 for ~r~~h~20.000 ~w~~h~coins and ~r~~h~150 ~w~~h~hours!!!", 5000 );
     return ( 1 );
     }
     }
     return ( 1 );
     }
Edited by Adrian_Petre
  • Upvote 1

 

 

Link to comment
Share on other sites

  • 0

 

Eu iti dau doar pentru ultimu model,iar dupa ala te iei tu...


forward scoatevip();
public scoatevip();
{
SendClientMessageToAll(playerid, COLOR_RED, "%s a ramas fara VIP.Motiv:I s-a scurs termenul.", giveplayer);;
PlayerInfo[ playerid ][ pVip ] = 0;
}

case 9:
     {
     if ( PlayerInfo[ playerid ][ Coins ] < 50 )
                        return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~coins~w~~h~ to buy this option !" );

                    if ( PlayerInfo[ playerid ][ hours ] < 4000 )
                        return Info( playerid, "~r~~h~ERROR:~n~~w~~h~You don't have enough ~r~~h~hours~w~~h~ to buy this option !" );

                    PlayerInfo[ playerid ][ pVip ] = 10;
     PlayerInfo[ playerid ][ hours ] -= 50;
     PlayerInfo[ playerid ][ Coins ] -= 4000;
     SetTimer("scoatevip", 604800, false);// 604800 inseamna timpu in milisecunde. *7 zile*
     Info( playerid, "~y~~h~INFO:~n~~w~~h~You have just bought VIP Level 10 for ~r~~h~20.000 ~w~~h~coins and ~r~~h~150 ~w~~h~hours!!!", 5000 );
     return ( 1 );
     }
     }
     return ( 1 );
     }

O intrebare cum pot sa-l fac sa apara la /stats ex Vip Level : 10 ( 30 Days )

Si daca el se salveaza chiar daca ies dupa server si intru 

Link to comment
Share on other sites

  • 0

Ceea ce ceri tu aici , este un script complet.

 

Incearca sa faci un public care are timer :) si controleaza cat timp i-a ramas si atunci pui la status , eu nu iti voi da scriptu gata facut deoarece asa nu vei invata nici macar o singura data cum se face. Am observat ca ai GM-ul WOS acel GM are un stock numit timec daca nu ma insel , acel stock il poti folosi pentru status.

 

EDIT: Adrian , ce i-ai dat tu , se v-a face bug:)  deoarece , o data ce persoana respectiva are  vip temporar si re-intra pe server , nu va mai fi temporar deoarece acel timer se v-a "distruge".

Edited by Ph0eniX
Link to comment
Share on other sites

  • 0
stock timec( timestamp, compare = -1 )
{
    if ( compare == -1 )
		compare = gettime( );

    new
        n,
        Float:d = ( timestamp > compare ) ? timestamp - compare : compare - timestamp,
        returnstr[128]
	;
    if ( d < 60 )
	{
        format( returnstr, sizeof( returnstr ), "{FF0000}({FFFFFF}1 {FF0000}Minute)" );
        return returnstr;
    }
	else if ( d < 3600 )
	{
        n = floatround( floatdiv( d, 60.0 ), floatround_floor );
        format( returnstr, sizeof( returnstr ), "Minute" );
    }
	else if ( d < 86400 )
	{
        n = floatround( floatdiv( d, 3600.0 ), floatround_floor );
        format( returnstr, sizeof( returnstr ), "Hour" );
    }
	else if ( d < 2592000 )
	{
        n = floatround( floatdiv( d, 86400.0 ), floatround_floor );
        format( returnstr, sizeof( returnstr ), "Day" );
    }
	else if ( d < 31536000 )
 	{
        n = floatround( floatdiv( d, 2592000.0 ), floatround_floor );
        format( returnstr, sizeof( returnstr ), "Month" );
    }
    if ( n == 1 )
        format( returnstr, sizeof( returnstr ), "{FF0000}({FFFFFF}1 {FF0000}%s)", returnstr );
    else
        format( returnstr, sizeof( returnstr ), "{FF0000}({FFFFFF}%d {FF0000}%ss)", n, returnstr );

    return returnstr;
}
Link to comment
Share on other sites

  • 0

Absolut nimeni nu o sa-ti faca tie un sistem de VIP / Admin temporar fara sa ceara nimic la schimb:) aici e ajutor scripting nu "vreau script" , in plus ce ai dat tu acolo este doar buyvip , din acel buy vip nu reiese nimic ca ai incercat ceva temporar.

Link to comment
Share on other sites

  • 0

Absolut nimeni nu o sa-ti faca tie un sistem de VIP / Admin temporar fara sa ceara nimic la schimb:) aici e ajutor scripting nu "vreau script" , in plus ce ai dat tu acolo este doar buyvip , din acel buy vip nu reiese nimic ca ai incercat ceva temporar.

Frate tu sti sa citesti ?

Ati incercat sa rezolvati singur ?:Da am incercat dupa http://forum.sa-mp.c...ad.php?t=254915dar nu am reusit. 
 Ma poate ajuta cineva
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

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