Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

Posted

Salut am incercat sa creez gate cu comanda dar comanda nu merge. Nu cred ca e bine MoveObject ca am pus de la alt gm ca nu am stiut sa pun eu coord. Va rog ajutatima si lamuritima cum sa fac gate cu comanda care sa mearga multumesc . Asta e gate:

#include <a_samp>

new gate;

public OnFilterScriptInit()
{
	CreateObject(976, 1544.945313, -1630.798462, 12.697852, 0.0000, 0.0000, 90.0000);
	CreateObject(983, 1544.905762, -1618.998047, 13.238116, 0.0000, 0.0000, 0.0000);
	CreateObject(983, 1544.604614, -1634.491943, 13.237661, 0.0000, 0.0000, 0.0000);
}


main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}


public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
		if(strcmp(cmdtext, "/opengate", true) == 0)
{
   MoveObject(gate, 1598.268677, -1638.331177, 13.752552, 2);
   return 1;
}

if(strcmp(cmdtext, "close", true) ==0)
{
   MoveObject(gate, 1544.945313, -1630.798462, 12.697852);
   return 1;
}
}

8 answers to this question

Recommended Posts

Posted

La on filter scriptinit pui asta:

gate =  CreateObject(976, 1544.945313, -1630.798462, 12.697852, 0.0000, 0.0000, 90.0000);

gate =  CreateObject(983, 1544.905762, -1618.998047, 13.238116, 0.0000, 0.0000, 0.0000);

gate =  CreateObject(983, 1544.604614, -1634.491943, 13.237661, 0.0000, 0.0000, 0.0000);

Posted

Da mersi , merge dar nu se deschide in sus ci merge in fata si nu revine inapoi. Cum sa fac sa Se deschida intro parte? ca si cand poarta e pe rotile ?

Nu ai pus coordonatele bune :P

Posted

Nu ai pus coordonatele bune :P

Esti un geniu, daca n-ai de gand sa-l ajuti mai bine nu mai posta.

Trebuie sa numesti obiectele.

Ca sa se duca in sus pune coordonatele originale si Z-ul il pui de exemplu +5.

Ca sa se intoarca pui comanda /close, cu MoveObject, cu coordonatele de la inceput, de la OnFilterScriptInit.

Ti l-am facut eu:

#include <a_samp>

new gate1;

public OnFilterScriptInit()
{
   gate1 = CreateObject(976, 1544.945313, -1630.798462, 12.697852, 0.0000, 0.0000, 90.0000);
   CreateObject(983, 1544.905762, -1618.998047, 13.238116, 0.0000, 0.0000, 0.0000);
   CreateObject(983, 1544.604614, -1634.491943, 13.237661, 0.0000, 0.0000, 0.0000);
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/opengate", true) == 0)
	{
	   MoveObject(gate1, 1544.945313, -1630.798462, 12.697852+5, 3);
	   return 1;
	}

	if(strcmp(cmdtext, "/close", true) ==0)
	{
	   MoveObject(gate1, 1544.945313, -1630.798462, 12.697852, 3);
	   return 1;
	}
	return 0;
}

Daca or fi si celelalte porti, repeta ce am facut eu cu MoveObject si "numirea" aia si pune MoveObject-u in comenzi.



Citeste asta: http://www.sa-mp.ro/forum/index.php/topic,1600.0.html

Inainte sa postati cautati !!!

Posted

Da mersi mult Stuntman dar se ridica in sus as vrea sa fac sa se deschida in lateral cum fac? Mersi mult daca ma ajuti si cu asta. Scz ca te tot sacai

Modific x si/sau y pentru asta, mai bine faci in MTA poarta deschisa si inchisa si pe urma modifici in script.

Partea cu sacaitul ... forumul acesta d'aia e facut, sa sacai pe toti cu probleme scripting :))

Posted

Mai am o nelamurire de care am uitat. Imi da erori cand pun  sa nu poata deschide doar Membri FBI , PD , NG. Imi da urmatoarele errori

C:\DOCUME~1\User\Desktop\2134\SERVER~1\SERVER~2\FILTER~1\gates.pwn(20) : error 017: undefined symbol "PlayerInfo"
C:\DOCUME~1\User\Desktop\2134\SERVER~1\SERVER~2\FILTER~1\gates.pwn(20) : warning 215: expression has no effect
C:\DOCUME~1\User\Desktop\2134\SERVER~1\SERVER~2\FILTER~1\gates.pwn(20) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\User\Desktop\2134\SERVER~1\SERVER~2\FILTER~1\gates.pwn(20) : error 029: invalid expression, assumed zero
C:\DOCUME~1\User\Desktop\2134\SERVER~1\SERVER~2\FILTER~1\gates.pwn(20) : fatal error 107: too many error messages on one line
Commanda
	if (strcmp("/opengate", cmdtext, true) == 0)
	{
	if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2 ||PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3)
		{
      	MoveObject(gate1, 1544.905762, -1618.998047, 13.238116+1, 3);
		return 1;
	}

Posted

Mai am o nelamurire de care am uitat. Imi da erori cand pun  sa nu poata deschide doar Membri FBI , PD , NG. Imi da urmatoarele errori

C:\DOCUME~1\User\Desktop\2134\SERVER~1\SERVER~2\FILTER~1\gates.pwn(20) : error 017: undefined symbol "PlayerInfo"
C:\DOCUME~1\User\Desktop\2134\SERVER~1\SERVER~2\FILTER~1\gates.pwn(20) : warning 215: expression has no effect
C:\DOCUME~1\User\Desktop\2134\SERVER~1\SERVER~2\FILTER~1\gates.pwn(20) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\User\Desktop\2134\SERVER~1\SERVER~2\FILTER~1\gates.pwn(20) : error 029: invalid expression, assumed zero
C:\DOCUME~1\User\Desktop\2134\SERVER~1\SERVER~2\FILTER~1\gates.pwn(20) : fatal error 107: too many error messages on one line
Commanda
	if (strcmp("/opengate", cmdtext, true) == 0)
	{
	if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2 ||PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3)
		{
      	MoveObject(gate1, 1544.905762, -1618.998047, 13.238116+1, 3);
		return 1;
	}
adauga asta in fs la u si o sa mearga
enum pInfo
{
	pKey[128],
	pLevel,
	pAdmin,
	pGM,
	pDonateRank,
	gPupgrade,
	pConnectTime,
	pReg,
	pSex,
	pAge,
	pOrigin,
	pCK,
	pMuted,
	pMuteTime,
	pExp,
	pCash,
	pAccount,
    pPassport,
	pCrimes,
	pKills,
	pDeaths,
	pArrested,
	pWantedDeaths,
	pPhoneBook,
	pLottoNr,
	pFishes,
	pBiggestFish,
	pJob,
	pPayCheck,
	pHeadValue,
	pJailed,
	pJailTime,
	pBlackList,
	pMoneyClear,
	pBLTime,
	pHackTog,
	pMats,
	pDrugs,
	pLeader,
	pMember,
	pFMember,
	pRank,
	pChar,
	pContractTime,
	pDetSkill,
	pSexSkill,
	pBoxSkill,
	pLawSkill,
	pMechSkill,
	pJackSkill,
	pCarSkill,
	pNewsSkill,
	pDrugsSkill,
	pCookSkill,
	pFishSkill,
	Float:pHealth,
	Float:pArmour,
	Float:pSHealth,
	pInt,
	pLocal,
	pTeam,
	pModel,
	pPnumber,
	pPhousekey,
	pPbiskey,
	Float:pPos_x,
	Float:pPos_y,
	Float:pPos_z,
	pCarLic,
	pFlyLic,
	pBoatLic,
	pFishLic,
	pTow,
	pGunLic,
	pGun1,
	pGun2,
	pGun3,
	pGun4,
	pAmmo1,
	pAmmo2,
	pAmmo3,
	pAmmo4,
	pCarTime,
	pPayDay,
	pPayDayHad,
	pCDPlayer,
	pWins,
	pLoses,
	pAlcoholPerk,
	pDrugPerk,
	pMiserPerk,
	pPainPerk,
	pTraderPerk,
	pTut,
	pMissionNr,
	pWarns,
	pFACWarns,
	pADMWarns,
	pGMWarns,
	pAdjustable,
	pFuel,
	pMarried,
	pMarriedTo[128],
	pStoredDrugs,
	pStoredMats,
	pRequestingBackup,
    pLocked,
	pSf,
    pMatsHouse,
    pDrugsHouse,
};
new PlayerInfo[MAX_PLAYERS][pInfo];

RESPECT:Zh3r0 UNRESEPECT:STUNTMAN

Zh3r0 The Best Man

StuntMan:Scoate gunoiu de la cal =))

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.