Jump to content
  • 0

2 Probleme care ma poate ajuta


Costy1998

Question

1.Prima problema.

Deci doresc sa fac o mica comanda in care sa scri /getmyvip si sa-ti dea vip level 1 .

Folosesc Ladmin.

Am incercat sa fac din comanda /setvip da nam reusit uitati comanda /setvip .

dcmd_setvip(playerid,params[]) {
	if(PlayerInfo[playerid][LoggedIn] == 1) {
		if(PlayerInfo[playerid][Vip] >= 5 || IsPlayerAdmin(playerid)) {
		    new tmp[256], tmp2[256], Index;		tmp = strtok(params,Index), tmp2 = strtok(params,Index);
		    if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /setvip [playerid] [vip level]");
	    	new player1, vip, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
			player1 = strval(tmp);
			if(!strlen(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setvip [playerid] [vip level]");			vip = strval(tmp2);

			if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
				if(PlayerInfo[player1][LoggedIn] == 1) {
					if(vip > ServerInfo[MaxVipLevel] ) return SendClientMessage(playerid,red,"ERROR: Incorrect vip Level");
					if(vip == PlayerInfo[player1][Vip]) return SendClientMessage(playerid,red,"ERROR: Player is already this vip level");
	       			CMDMessageToAdmins(playerid,"SETVIP");
					GetPlayerName(player1, playername, sizeof(playername));	GetPlayerName(playerid, adminname, sizeof(adminname));
			       	new year,month,day;   getdate(year, month, day); new hour,minute,second; gettime(hour,minute,second);

					if(vip > 0) format(string,sizeof(string),"Administrator %s has set you to Vip Status [Vip level %d]",adminname, vip);
					else format(string,sizeof(string),"Administrator %s has set you to Player Status [Vip level %d]",adminname, vip);
					SendClientMessage(player1,blue,string);

					if(vip > PlayerInfo[player1][Vip]) GameTextForPlayer(player1,"Promoted Vip", 2000, 3);
					else GameTextForPlayer(player1,"Demoted Vip", 2000, 3);

					format(string,sizeof(string),"You have made %s Vip Level %d on %d/%d/%d at %d:%d:%d", playername, vip, day, month, year, hour, minute, second); SendClientMessage(playerid,blue,string);
					format(string,sizeof(string),"Administrator %s has made %s Vip Level %d on %d/%d/%d at %d:%d:%d",adminname, playername, vip, day, month, year, hour, minute, second);
					SaveToFile("VipLog",string);
					dUserSetINT(PlayerName2(player1)).("vip",(vip));
					PlayerInfo[player1][Vip] = vip;
					return PlayerPlaySound(player1,1057,0.0,0.0,0.0);
				} else return SendClientMessage(playerid,red,"ERROR: Player must be registered and logged in to be vip");
			} else return SendClientMessage(playerid, red, "Player is not connected");
		} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
	} else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
2.A doua Problema Am incercat sa fac si /giveallcoins acesta comanda ar trebui sa dea coins la toti playri de pe server Io am incercat in mai multe moduri sa o fac da nam putut. Uitati comenzile de coins care le am momentan
dcmd_givecoins(playerid, params[])
{
if(sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, orange, "USAGE : /givecoins [playerid] [amount]");
	else if(giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, red, "ERROR : That player is not connected!");
	 else if(giveplayerid == playerid) SendClientMessage(playerid, red, "ERROR : You cant send yourself coins!");
	  else if(amount > pInfo[playerid][Coins]) SendClientMessage(playerid, red, "ERROR : You dont have that amount of coins!");
		else
		{
		new string[156],file[100],Name[MAX_PLAYER_NAME],Ip[16],name[MAX_PLAYER_NAME]; GetPlayerName(giveplayerid, name, sizeof(name));GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name);
		format(string, sizeof(string), "SERVER : You have succesfully sent %d coins to %s!", amount, name);
		SendClientMessage(playerid, red, string);
		format(string, sizeof(string), "SERVER : %s has given to you %d coins!", Name, amount);
		SendClientMessage(giveplayerid, red, string);
		pInfo[giveplayerid][Coins] += amount;
		pInfo[playerid][Coins] -= amount;
		dini_IntSet(file,"Coins", pInfo[giveplayerid][Coins]);
		dini_IntSet(file,"Coins", pInfo[playerid][Coins]);
		}
return 1;
}

dcmd_setcoins(playerid, params[])
{
	    if(IsPlayerAdmin(playerid) == 0) return SendClientMessage(playerid, red, "ERROR : Only admins can use that command!");
		if(sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, orange, "USAGE : /setcoins [playerid] [amount]");
		else if(giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, red, "ERROR : That player is not connected!");
		 else
		{
		new string[156],file[100],Name[MAX_PLAYER_NAME],Ip[16],name[MAX_PLAYER_NAME]; GetPlayerName(giveplayerid, name, sizeof(name));GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name);
	    format(string, sizeof(string), "You have succesfully setted %s coins to %d!", name, amount);
        SendClientMessage(playerid, Limegreen, string);
		format(string, sizeof(string), "Admin %s has setted your coins to %d!", Name, amount);
        SendClientMessage(giveplayerid, Limegreen, string);
		pInfo[giveplayerid][Coins] = amount;
		dini_IntSet(file,"Coins", pInfo[giveplayerid][Coins]);
		}
		return 1;
}

Ajutoru vostru fiti sigur ca no sal uit am un loc special la credits pentru voi.. :D

Multumesc Anticipat :D.

monitor.php?IP=31.14.12.120&PORT=7777&STYLE=5
Link to comment
Share on other sites

2 answers 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.