Jump to content
  • 0

Timer - GetGift


MrAndrei

Question

Problema intalnita (descriere):Timer Getgift
Ero(area / rile) / warning-(ul / urile):-
Liniile de cod / sursa / script-ul:-
Imagini / Video (optional):-
Ati incercat sa rezolvati singur?:Da.Doresc sa aflu cum creez un timer la getgift , gen , dau acum /getgift primesc cadoul iar la urmatorul payday sa pot da din nou getgift.Am incercat si singur insa nu am reusit.Am cautat si pe alte forumuri dar tot degeaba.Va multumesc.

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;
	}
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

La public Payday() pune

PlayerInfo[playerid][pGiftPoint] = 0;

Dar dupa acele mesaje cum ca ai luat payday-ul etc..

 

Sunt inca incepator in pawn. 

Am adaugat ce mi-ai zis tu dar am urmatoarele erori :

C:UsersAAADesktopGameMode RiseGamminGgamemodesfGaming.pwn(13879) : error 017: undefined symbol "playerid"
C:UsersAAADesktopGameMode RiseGamminGgamemodesfGaming.pwn(16992) : warning 209: function "OnDialogResponse" should return a value
Pawn compiler 3.2.3664     Copyright (c) 1997-2006, ITB CompuPhase




1 Error.

De eroarea 209 stiu de ea.Era si inainte.

 

Linia : 13879

PlayerInfo[playerid][pGiftPoint] = 0;
Link to comment
Share on other sites

  • 0

Adauga daca nu ai deja la enum pInfo

pGiftPoint,

La OnPlayerRegister

PlayerInfo[playerid][pGiftPoint] = 0;

.Si schimba din

PlayerInfo[playerid][pGiftPoint] = 0;

in

PlayerInfo[i][pGiftPoint] = 0;

Edited by Adrian_Petre

 

 

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.