Jump to content

Question

Posted (edited)

Problema intalnita (descriere): Nu pot sa dea 2 nume cand dau comanda /so . de exemplu " 

(megaphone)Politist %s : %s esti urmarit de Politie. Trage pe Dreapta

Prima data " Politist nume" apare, a 2-a oara nu apare numele, apare "Politistul `nume` : esti urmarit de Politie. Trage pe drepta. As vrea sa apara de 2 ori numele. Sper ca ati inteles ce vreau sa zic. (daca nu, uitati aici o poza  http://i.imgur.com/nVSaO16.png
Ero(area / rile) / warning-(ul / urile): ---
Liniile de cod / sursa / script-ul(obligatoriu):

CMD:so(playerid, params[]) {
	new
		id;

	if(sscanf(params, "us[128]", id)) {
		SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/whisper [playerid] [message]");
	}
	    if(IsPlayerConnected(id) && playerVariables[id][pStatus] >= 1) {
			if(IsPlayerInRangeOfPlayer(playerid, id, 100.0)) {
				if(playerVariables[id][pSeeWhisper] == 0) {
					new
						giveplayerName[MAX_PLAYER_NAME];

					GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

					format(szMessage, sizeof(szMessage), "(megaphone)Politist %s : {0064FF} %d esti urmarit de Politie. Trage pe Dreapta", szPlayerName);
					SendClientMessage(id, COLOR_YELLOW, szMessage);

					GetPlayerName(id, giveplayerName, MAX_PLAYER_NAME);

					format(szMessage, sizeof(szMessage), "(megaphone)Politist %s :{0064FF} %d esti urmarit de Politie. Trage pe Dreapta", giveplayerName);
					SendClientMessage(playerid, COLOR_YELLOW, szMessage);

				}
				else SendClientMessage(playerid, COLOR_GREY, "You're too far away.");
			}
	    }
	    else {
	        SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
	    }
	return 1;
}


Imagini / Video (optional): Poza cum vreau sa apara http://i.imgur.com/nVSaO16.png
Ati incercat sa rezolvati singur?:Da, am incercat sa adaug de 2 ori giveplayerName, dar fara reusita, si dupa szPlayerName si tot fara reusita

Edited by Masodion
update

12 answers to this question

Recommended Posts

  • 0
Posted

Ai făcut o varză dintre /w și ceea ce s-ar numi /so (probabil de la somație). Zi-mi te rog ce id au facțiunile de polițiști la tine sau dacă ai funcția IsACop() sau ceva de genul.

  • Upvote 1
  • 0
Posted

Ce ai în enum de la playerVariables? În ce mai salvezi date pentru playeri?

  • Upvote 1
  • 0
Posted

Te rog spune-mi toate datele ce le salvezi pentru playeri: pLevel, pGroup, pMember, pAdmin, pLeader[sunt niște exemple]...asta vreau să-mi spui de la tine din GM.

  • 0
Posted
enum playervEnum {
	Float: pHealth,
	Float: pArmour,
	Float: pPos[3],
	Float: specPos[3],
	pPassword[129],
	pStatus,
	pRPoints,
	pMoney,
	pAdminLevel,
	pManager,
	pCrimeReason[200],
	pAdminName[200],
	ReportText[128],
	ActiveReport,
	pInterior,
	pLevel,
	pInsurancePoints,
	pInsurancePoints2,
	pInsurancePoints3,
	pInsurancePoints4,
	pInsurance,
	pInsurance2,
	pInsurance3,
	pInsurance4,
	pTRoute,
	HoldingObject,
	pTrash,
	pFirstPerson,
	pCarSelected,
	pPDuty,
	pNMuted,
	pFarmerMoney,
	pRMuted,
	pNob[128],
	pHouse,
	pBusiness,
	pGlasses,
	ShowHealth,
	pClanTagType,
	pHelpedPlayers,
	pGiftHours,
	pHelperTokens,
	pHouseKey,
	pBusinessKey,
	pRob,
	pAplicationID,
	pAdminDuty,
	pAge,
	pSkinSet,
	pCall,
	pCarID1,
	pCarID2,
	pCarID3,
	pPiz,
	pAnticheatExemption,
	pTabbed,
	pPremiumPoints,
	pCarWeapons,
	pSpawnChange,
	pWarScore,
	pFWarns,
	pFPunish,
	pCarLicensePlate[32],
	pCarLicensePlate2[32],
	pCarLicensePlate3[32],
	pCarLicensePlate4[32],
	pCarKM,
	pCarKM2,
	pCarKM3,
	pCarKM4,
	pDrugs,
	pPhoneCredit, // Will be done in seconds.
	pWalkieTalkie, // -1 = no walkie, 0 = switched off
	pSpectating,
	pSpecSession,
	pConnectedSeconds,
	pSpamCount,
	pFishing,
	pPhone,
	pMuted,
	pVirtualWorld,
	pFish,
	pFishValue,
	pBanned,
	pTazer,
	pEvent,
	Float: pCarPos1[4],
	Float: pCarPos2[4],
	Float: pCarPos3[4],
	Float: pCarPos4[4],
	pReport,
	pPrisonTime,
	pPrisonID, // 3 = IN CHARACTER JAIL! (future reference)
	pHackWarnTime,
	pHelperDuty,
	pReportMessage[64],
	pPlayingHours,
	pSkin,
	pJob,
	pDriveLicense,
	pGunLicense,
	pBoatLicense,
	pFlyLicense,
	pAccent[40],
	pCarLic,
	pFlyLic,
	pGunLic,
	pPhoneNumber,
	ReportingPlayer,
	pSkinCount,
	pSeeOOC,
	pOOCMuted,
	pNewbieTimeout,
	pTutorial,
	pWeapons[13],
	pOutstandingWeaponRemovalSlot,
	pJetpack,
	pBankMoney,
	pHackWarnings,
	pEmail[255], // because this is the max length for a valid email.
	pSeconds,
	pFightStyle,
	pInternalID,
	pRespect,
	pGender,
	pNewbieEnabled,
	pSpeaker,
	pFirstLogin,
	pRobPoints,
	pHelper,
	pCarColour1[2],
	pCarColour2[2],
	pCarColour3[2],
	pCarColour4[2],
	pMatrunTime,
	pNormalName[MAX_PLAYER_NAME],
	pSelected[MAX_PLAYER_NAME],
	pReason[MAX_PLAYER_NAME],
	pReported,
	pReportAccepted,
	pReportAccepted2,
	pFP,
	pPhoneBook,
	pCheckpoint,
	pPMStatus,
	pOnRequest,
	Text3D: pAFKLabel,
	pGroup,
	pClan,
	pClanRank,
	pCarModel1,
	pCarModel2,
	pCarModel3,
	pCarModel4,
	pCarID4,
	pCarMods1[13],
	pCarMods2[13],
	pCarMods3[13],
	pCarMods4[13],
	pCarPaintjob,
	pCarPaintjob3,
	pCarPaintjob4,
	pCarLock,
	pWarns,
	pCarPaintjob2,
	pCarLock2,
	pCarLock3,
	pCarLock4,
	pGroupRank,
	pDropCarTimeout,
	pMaterials,
	pHeadValue,
	pDonate,
	pHospitalized,
	pFreezeTime,
	pFreezeType,
	pDrag,
	pAnimation,
	pPhoneStatus,
	pPhoneCall,
	pConnectionIP[32],
	pSeeWhisper,
	pCrimes,
	pArrests,
    pWarrants,
	pBackup,
	pPcarkey,
	pHouseRented,
	pWarDeaths,
	pInvite[MAX_PLAYER_NAME],
	pLastLogin[20],
	pColor,
	pDD,
	pDs,
	pDr,

 

  • 0
Posted (edited)

Vezi așa:

/so [id celui somat]

CMD:so(playerid, params[])
{
    new id, string[128], group = playerVariables[playerid][pGroup];

      if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_GREY, "Syntax: /so [id]");
      if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Nu poti sa te somezi pe tine");
    if(group != 1 && group != 2 && group != 3) return SendClientMessage(playerid, COLOR_RED, "You are not a Cop");
    if(IsPlayerConnected(id)&& playerVariables[id][pStatus] >= 1)
    {
		new copname[64],soname[64];
		GetPlayerName(playerid, copname, sizeof(copname));
		GetPlayerName(id, soname, sizeof(soname));
        format(string, sizeof(string), "(megaphone)Politist %s :{0064FF} %s esti urmarit de Politie. Trage pe Dreapta!", copname, soname);
    }
	else return SendClientMessage(playerid, COLOR_RED, "Acest jucator nu este conectat.");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        if(IsPlayerInRangeOfPoint(id,25.0,x,y,z))
        {
            SendClientMessage(i, COLOR_YELLOW, string);
        }
		else return SendClientMessage(playerid, COLOR_RED, "Acest jucator este prea departe");
    }
      return 1;
}

 

Edited by DCosmin
  • Upvote 1
  • 0
Posted

@DCosmin merge comanda, insa daca sunt prea departe nu imi da mesaj "esti prea departe de playerid" sau "acest jucator nu este conectat. Aici chiar nu imi dau seama cum sa fac, am citit multe comenzi si tot nu mi-am dat seama cum sa fac acel mesaj

  • 0
Posted
format(szMessage, sizeof(szMessage), "(megaphone)Politist %s :{0064FF} %d esti urmarit de Politie. Trage pe Dreapta", giveplayerName);

inlocuieste giveplayerName cu 

szPlayerName

Vezi daca merge .

  • 0
Posted

@NoNamed Te rog pe viitor să citești toate reply-urile anterioare ;) Problema a fost rezolvată. Singurul lucru care îl mai așteptam era o confirmare pentru T/C.

Topic Closed.

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.