Jump to content
  • 0

Timer - GetGift


MrAndrei

Question

Salutari SA-MP.Ro . 

Am creat comanda [/getgift] prin care primesti diferite lucruri , bani , rp , level etc.Insa , odata ce ai folosit aceasta comanda, nu  poti sa mai dai [/getgift] . Nu este un timer , nu este nimic , de aceea , intrebarea mea este urmatoarea:

 

Cum adaug un timer la [/getgift]. Gen , la 1-2-3 sa poti da din nou [/getgift].

 

Mai jos aveti comanda [/getgift]:

if(strcmp(cmd, "/getgift", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		    if(Cadou[playerid] == 0)
		    {
				if(PlayerToPoint(5.0, playerid, 1126.4187,-1450.0481,15.7969))
				{
				    new cadou = random(10);
				    if(cadou == 1)
				    {
				        GivePlayerCash(playerid, 50000);
				        Cadou[playerid] = 1;
				        GetPlayerName(playerid, sendername, sizeof(sendername));
				        format(string, sizeof(string), "((Giftbox: %s a castigat 50.000$ la getgift.))",sendername,playerid);
					    OOCOff(COLOR_YQLMX, string);
				        //GameTextForPlayer(playerid, "~g~50,000$!", 5000, 1);
				        return 1;
					}
					if(cadou == 2)
					{
						PlayerInfo[playerid][pExp] += 4;
						Cadou[playerid] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						format(string, sizeof(string), "((Giftbox: %s a castigat 4Respect Point-uri la getgift.))",sendername,playerid);
					    OOCOff(COLOR_YQLMX, string);
						//GameTextForPlayer(playerid, "~g~4 Respect Points!", 5000, 1);
						return 1;
					}
					if(cadou == 3)
					{
					    PlayerInfo[playerid][pLevel] += 1;
					    Cadou[playerid] = 1;
					    GetPlayerName(playerid, sendername, sizeof(sendername));
					    format(string, sizeof(string), "((Giftbox: %s a castigat 1 Level UP la getgift.))",sendername,playerid);
					    OOCOff(COLOR_YQLMX, string);
					    //GameTextForPlayer(playerid, "~g~Level UP!", 5000, 1);
					    return 1;
					}
					if(cadou == 4)
					{
					    PlayerInfo[playerid][pSMS] += 900;
					    Cadou[playerid] = 1;
					    GetPlayerName(playerid, sendername, sizeof(sendername));
					    format(string, sizeof(string), "((Giftbox: %s a castigat 900 de SMS-uri la getgift.))",sendername,playerid);
					    OOCOff(COLOR_YQLMX, string);
					    //GameTextForPlayer(playerid, "~g~900 SMS!", 5000, 1);
					    return 1;
					}
					if(cadou == 5)
					{
					    PlayerInfo[playerid][pCall] += 1500;
					    Cadou[playerid] = 1;
					    GetPlayerName(playerid, sendername, sizeof(sendername));
					    format(string, sizeof(string), "((Giftbox: %s a castigat 1.5000 de apeluri la getgift.))",sendername,playerid);
					    OOCOff(COLOR_YQLMX, string);
					    //GameTextForPlayer(playerid, "~g~1500 calls!", 5000, 1);
					    return 1;
					}
					if(cadou == 6)
					{
					    GivePlayerCash(playerid, 150000);
					    Cadou[playerid] = 1;
					    GetPlayerName(playerid, sendername, sizeof(sendername));
					    format(string, sizeof(string), "((Giftbox: %s a castigat 150.000$ la getgift.))",sendername,playerid);
					    OOCOff(COLOR_YQLMX, string);
					    //GameTextForPlayer(playerid, "~g~150,000$!", 5000, 1);
					    return 1;
					}
					if(cadou == 7)
					{
					    GivePlayerCash(playerid, 200000);
					    Cadou[playerid] = 1;
					    GetPlayerName(playerid, sendername, sizeof(sendername));
					    format(string, sizeof(string), "((Giftbox: %s a castigat 200.000$ la getgift.))",sendername,playerid);
					    OOCOff(COLOR_YQLMX, string);
					    //GameTextForPlayer(playerid, "~g~200,000$!", 5000, 1);
					    return 1;
					}
					if(cadou == 8)
					{
					    PlayerInfo[playerid][pExp] += 7;
					    Cadou[playerid] = 1;
					    GetPlayerName(playerid, sendername, sizeof(sendername));
					    format(string, sizeof(string), "((Giftbox: %s a castigat 7 Respect Point-uri la getgift.))",sendername,playerid);
					    OOCOff(COLOR_YQLMX, string);
					    //GameTextForPlayer(playerid, "~g~7 Respect Points!", 5000, 1);
					    return 1;
					}
					if(cadou == 9)
					{
					    PlayerInfo[playerid][pExp] += 5;
					    Cadou[playerid] = 1;
					    GetPlayerName(playerid, sendername, sizeof(sendername));
					    format(string, sizeof(string), "((Giftbox: %s a castigat 5 Respect Point-uri la getgift.))",sendername,playerid);
					    OOCOff(COLOR_YQLMX, string);
					    //GameTextForPlayer(playerid, "~g~5 Respect Points!", 5000, 1);
					    return 1;
					}
					else if(cadou == 10)
					{
					    PlayerInfo[playerid][pSMS] += 7000;
					    Cadou[playerid] = 1;
					    GetPlayerName(playerid, sendername, sizeof(sendername));
					    format(string, sizeof(string), "((Giftbox: %s a castigat 7.000 de SMS-uri la getgift.))",sendername,playerid);
					    OOCOff(COLOR_YQLMX, string);
					    //GameTextForPlayer(playerid, "~g~7000 SMS!", 5000, 1);
					    return 1;
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_YELLOW,"GiftBox:Nu esti la GiftBox!");
					SendClientMessage(playerid, COLOR_YELLOW,"GiftBox:Ti-a post pus un marker de culoare rosie pe mini-map.Urmeaza-l pentru a ajunge la Giftbox.!");
					SetPlayerCheckpoint(playerid, 1126.4187,-1450.0481,15.7969,5.0);
					CP[playerid] = 700;
				}
			}
			else
			{
			    SCM(playerid, -1, "GiftBox:Ai folosit deja aceasta comanda!");
			    return 1;
			}
		}
		return 1;
	}

 Va multumesc pentru ajutor! O zi placuta!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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.