Care ma ajuta si pe mine cu o comanda?
#1

Buna all. Vreau si eu o comanda dak ma puteti ajuta. am facut ceva, dar imi zice ca nu sunt admin cand o scriu in consola Ma puteti ajuta cu comanda /fine ?
E o comanda cu care ii poti scade bani unui user daca a gresit cu ceva, fara ai mai da kick/warn/ban, adik pentru /ad aiurea (pe servere RP). Care ma poate ajuta? va las si un ID de messenger... tyger.black

Si inca ceva: HOSTEZ SERVERE DE SA-MP (ROLEPLAY) GRATIS!
Reply
#2

Ai fakut in joc, /rcon login [ password ] ?
Reply
#3

mda, am facut si merge gresit, admin merge doar la playerii care nu sunt amdin, si nu scad banii
Reply
#4

Posteaza comanda care ai facut-o tu aici.
Reply
#5

asta este, o pot pune ca FS sau trebuie pusa in GM?

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" /fine by iNT3X             ");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

if(strcmp(cmd, "/fine", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(PlayerInfo[playerid][pAdmin] < 3)
			{
			  SendClientMessage(playerid, COLOR_GREY, "  You are not an Admin!");
			  return 1;
			}
	  	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
      tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
				return 1;
			}
			moneys = strval(tmp);
			if(moneys < 1 || moneys > 999999999) { SendClientMessage(playerid, COLOR_GREY, "  Fine Money can't be below 1 or higher then 999999999 !"); return 1; }
			if(IsPlayerConnected(giveplayerid))
			{
			  if(giveplayerid != INVALID_PLAYER_ID)
			  {
			    if (ProxDetectorS(8.0, playerid, giveplayerid))
					{
					  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						new length = strlen(cmdtext);
						while ((idx < length) && (cmdtext[idx] <= ' '))
						{
							idx++;
						}
						new offset = idx;
						new result[64];
						while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
						{
							result[idx - offset] = cmdtext[idx];
							idx++;
						}
						result[idx - offset] = EOS;
						if(!strlen(result))
						{
							SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
							return 1;
						}
						format(string, sizeof(string), "AdmCmd: %s was fined by an admin, reason: %s", giveplayer, sendername, cmdtext);
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						GivePlayerMoney(giveplayer,-moneys);
					}
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "  That player is Offline !");
			  return 1;
			}
		}
		return 1;
		
		#endif
Reply
#6

Ti l-am facut eu ca FS.

Код:
#include <a_samp>
#include <core>
#include <float>
#include <file>
#include <utils>

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_LIGHTRED 0xFF6347AA

forward ProxDetectorS(Float:radi, playerid, targetid);

enum pInfo
{
	pKey[128],
	pLevel,
	pAdmin,
	pDonateRank,
	gPupgrade,
	pConnectTime,
	pReg,
	pSex,
	pAge,
	pOrigin,
	pCK,
	pMuted,
	pExp,
	pCash,
	pAccount,
	pCrimes,
	pKills,
	pDeaths,
	pArrested,
	pWantedDeaths,
	pPhoneBook,
	pLottoNr,
	pFishes,
	pBiggestFish,
	pJob,
	pPayCheck,
	pHeadValue,
	pJailed,
	pJailTime,
	pMats,
	pDrugs,
	pLeader,
	pMember,
	pFMember,
	pRank,
	pChar,
	pContractTime,
	pDetSkill,
	pSexSkill,
	pBoxSkill,
	pLawSkill,
	pMechSkill,
	pJackSkill,
	pCarSkill,
	pNewsSkill,
	pDrugsSkill,
	pCookSkill,
	pFishSkill,
 	pRobSkill,
	Float:pHealth,
	Float:pSHealth,
	pInt,
	pLocal,
	pTeam,
	pModel,
	pPnumber,
	pPhousekey,
	pPbiskey,
	Float:pPos_x,
	Float:pPos_y,
	Float:pPos_z,
	pTow,
	pRob,
	pSf,
	pGangteam,
	pCarLic,
	pFlyLic,
	pBoatLic,
	pFishLic,
	pGunLic,
	pMatsLic,
	pPassport,
	pGun1,
	pGun2,
	pGun3,
	pGun4,
	pAmmo1,
	pAmmo2,
	pAmmo3,
	pAmmo4,
	pCarTime,
	pPayDay,
	pPayDayHad,
	pCDPlayer,
	pWins,
	pLoses,
	pAlcoholPerk,
	pDrugPerk,
	pMiserPerk,
	pPainPerk,
	pTraderPerk,
	pTut,
	pMissionNr,
	pWarns,
	pAdjustable,
	pFuel,
	pMarried,
	pMarriedTo[128],
};
new PlayerInfo[MAX_PLAYERS][pInfo];

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" /fine by iNT3X             ");
	print("--------------------------------------\n");
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
  new tmp[256];
  new giveplayerid, moneys, idx;
  new giveplayer[MAX_PLAYER_NAME];
  new sendername[MAX_PLAYER_NAME];
  new string[256];
  
  if(strcmp(cmdtext, "/fine", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(PlayerInfo[playerid][pAdmin] < 3)
			{
			  SendClientMessage(playerid, COLOR_GREY, "  You are not an Admin!");
			  return 1;
			}
	  	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
      tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
				return 1;
			}
			moneys = strval(tmp);
			if(moneys < 1 || moneys > 999999999) { SendClientMessage(playerid, COLOR_GREY, "  Fine Money can't be below 1 or higher then 999999999 !"); return 1; }
			if(IsPlayerConnected(giveplayerid))
			{
			  if(giveplayerid != INVALID_PLAYER_ID)
			  {
			    if (ProxDetectorS(8.0, playerid, giveplayerid))
					{
					  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						new length = strlen(cmdtext);
						while ((idx < length) && (cmdtext[idx] <= ' '))
						{
							idx++;
						}
						moneys = strvalEx(tmp);
						new offset = idx;
						new result[64];
						while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
						{
							result[idx - offset] = cmdtext[idx];
							idx++;
						}
						result[idx - offset] = EOS;
						if(!strlen(result))
						{
							SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
							return 1;
						}
						format(string, sizeof(string), "AdmCmd: %s was fined by an admin, reason: %s", giveplayer, sendername, cmdtext);
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						GivePlayerMoney(giveplayer, -moneys);
					}
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "  That player is Offline !");
			  return 1;
			}
		}
		return 1;
	}
	return 0;
}

public ProxDetectorS(Float:radi, playerid, targetid)
{
  if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
	{
		new Float:posx, Float:posy, Float:posz;
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		//radi = 2.0; //Trigger Radius
		GetPlayerPos(targetid, posx, posy, posz);
		tempposx = (oldposx -posx);
		tempposy = (oldposy -posy);
		tempposz = (oldposz -posz);
		if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
		{
			return 1;
		}
	}
	return 0;
}

stock strvalEx( const string[] )
{
  //Register Protection
  if( strlen( string ) >= 50 ) return 0;
  return strval(string);
}

strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}
Da o eroare dar nu reusesc s-o fac.

Daca si la tine da eroarea, copii doar comanda din ce ti-am facut eu in GM-ul tau. Adica asta:
Код:
if(strcmp(cmdtext, "/fine", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(PlayerInfo[playerid][pAdmin] < 3)
			{
			  SendClientMessage(playerid, COLOR_GREY, "  You are not an Admin!");
			  return 1;
			}
	  	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
      tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
				return 1;
			}
			moneys = strval(tmp);
			if(moneys < 1 || moneys > 999999999) { SendClientMessage(playerid, COLOR_GREY, "  Fine Money can't be below 1 or higher then 999999999 !"); return 1; }
			if(IsPlayerConnected(giveplayerid))
			{
			  if(giveplayerid != INVALID_PLAYER_ID)
			  {
			    if (ProxDetectorS(8.0, playerid, giveplayerid))
					{
					  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						new length = strlen(cmdtext);
						while ((idx < length) && (cmdtext[idx] <= ' '))
						{
							idx++;
						}
						moneys = strvalEx(tmp);
						new offset = idx;
						new result[64];
						while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
						{
							result[idx - offset] = cmdtext[idx];
							idx++;
						}
						result[idx - offset] = EOS;
						if(!strlen(result))
						{
							SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
							return 1;
						}
						format(string, sizeof(string), "AdmCmd: %s was fined by an admin, reason: %s", giveplayer, sendername, cmdtext);
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						GivePlayerMoney(giveplayer, -moneys);
					}
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "  That player is Offline !");
			  return 1;
			}
		}
		return 1;
	}
Reply
#7

ms mult, dar il pot pastra ca FS? si sa nu-l mai bag in GM?
Reply
#8

Quote:
Originally Posted by bL1nd3R
ms mult, dar il pot pastra ca FS? si sa nu-l mai bag in GM?
Faci cum vrei. Dar daca il pastrezi ca FS, o sa primesti o eroare pe care nu am reusit s-o rezolv. Nu mi-am dat seama ce are.
Reply
#9

dar v-a functiona corect? adik nu imi va face probleme?
Reply
#10

Quote:
Originally Posted by bL1nd3R
dar v-a functiona corect? adik nu imi va face probleme?
Fa-i o copie la GM pentru orice eventualitate, si dupaia adauga comanda.
nu ma pricep chiar asa de bine la modurile astea godfather (role play). :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)