Jump to content
  • 0

problema winevent


InceMan

Question

Problema intalnita (descriere):cand dau winevent pe un player anume imi zice ca tot eu am castigat si daca am 200000k la mine si eventul e de 5000k imi sterge bani aia care ii am  cum ii rezolv bugul
Ero(area / rile) / warning-(ul / urile):nu sunt erori
Liniile de cod / sursa / script-ul(obligatoriu):

CMD:winevent(playerid,params[])
{
    if(playerVariables[playerid][pAdminLevel] < 1)
    if(sscanf(params,"s",playerid)) return SendClientMessage(playerid,COLOR_RED,"Usage: /eventwin [Player name/ID].");
    if(playerid==INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"No such player.");
        else
    {
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
        new str[128];
        format(str,128,"{FF9900}%s {CCCCCC}a castigat eventul si a primit {00CC00}$%d!",pname, result,prize);
        

        SendClientMessageToAll(COLOR_GREEN,str);
        
        new string[64];
        format(string,64,"You have won the event '%s'!",result);
        GameTextForPlayer(playerid,string,5,3000);
    GivePlayerMoney(playerid, prize);
    }
    return 1;
}


Imagini / Video (optional):http://imgur.com/apY4s4K
Ati incercat sa rezolvati singur?: da

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0
12 hours ago, Geani said:

merge acum dar nu imi raman bani care ii dau la event mii da in cash dar dupa 20 sec mii ea inapoi poate nui buna aia cu 


 GivePlayerMoney(targetid, prize);

si sa o trec in

SetPlayerMoney(targetid, prize); ?

 

playerVariables[targetid][pMoney] += prize;

j3V8Znq.png

5IGyOAw.png

Link to comment
Share on other sites

  • 0

Nu folosesti bine SSCANF.

asa e varianta corecta:

CMD:winevent(playerid,params[])
{
    if(playerVariables[playerid][pAdminLevel] < 1)
			return SendClientMessage(playerid, COLOR_RED, "Mesaj de eroare.");
		
	new targetid;
	
    if(sscanf(params,"s",targetid)) 
			return SendClientMessage(playerid, COLOR_RED, "Usage: /eventwin [Player name/ID].");
			
    if(targetid == INVALID_PLAYER_ID) 
			return SendClientMessage(playerid, COLOR_RED, "No such player.");
    
	new pname[MAX_PLAYER_NAME];
	GetPlayerName(targetid, pname, MAX_PLAYER_NAME);
	
	new str[128];
	format(str, 128, "{FF9900}%s {CCCCCC}a castigat eventul si a primit {00CC00}$%d!", pname, result, prize);
	SendClientMessageToAll(COLOR_GREEN, str);

	format(str, 64, "You have won the event '%s'!", result);
	GameTextForPlayer(targetid, str, 5, 3000);
    GivePlayerMoney(targetid, prize);
    
    return 1;
} 

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

merge acum dar nu imi raman bani care ii dau la event mii da in cash dar dupa 20 sec mii ea inapoi poate nui buna aia cu 

 GivePlayerMoney(targetid, prize);

si sa o trec in

SetPlayerMoney(targetid, prize); ?

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
  • 0
2 hours ago, EquiNox said:

playerVariables[targetid][pMoney] += prize;

multumesc mi-ai fost de folos merge foarte bine

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

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.