Jump to content
  • 0

Problema comanda /invite.


Masodion

Question

Problema intalnita (descriere): Am incercat sa fac comanda /invite (copiata dintr-un alt gamemode) si imi da erorile de mai jos.
Ero(area / rile) / warning-(ul / urile): 

C:\Users\Mihai\Desktop\0\gamemodes\GM.pwn(2088) : error 017: undefined symbol "giveplayer"
C:\Users\Mihai\Desktop\0\gamemodes\GM.pwn(2088) : error 017: undefined symbol "giveplayer"
C:\Users\Mihai\Desktop\0\gamemodes\GM.pwn(2088) : error 029: invalid expression, assumed zero
C:\Users\Mihai\Desktop\0\gamemodes\GM.pwn(2088) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


Liniile de cod / sursa / script-ul(obligatoriu): 

//----------------------------------[INVITE]------------------------------------------------
	if(strcmp(cmd, "/invite", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			temp = strtok(cmdtext, idx);
			if(!strlen(temp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "{55D4FF}SCRIE:{B4B4B4} /invite [playerid/PartOfName]");
				return 1;
			}
			new para1;
			new ftext[20];
			para1 = ReturnUser(temp);
			if (PlayerInfo[playerid][pLeader] >= 1 || PlayerInfo[playerid][pRank] == 6)
			{
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
					    if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255 || PlayerInfo[para1][pLeader] == 0)
					    {
					        if(PlayerInfo[para1][pJob] > 0)
					        {
					            SendClientMessage(playerid, COLOR_GREY, "   Can't invite him, player has a Job !");
					            return 1;
					        }
					        if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Police Force"; ChosenSkin[para1] = 280; SetPlayerSkin(para1, 280); }
					        else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "S.R.I/ATF"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286); }
					        else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Armata Romana"; ChosenSkin[para1] = 287; SetPlayerSkin(para1, 287); }
					        else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Fireman/Ambulance"; ChosenSkin[para1] = 70; SetPlayerSkin(para1, 70); }
					        else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Frusin"; ChosenSkin[para1] = 124; SetPlayerSkin(para1, 124); }
					        else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Racean"; ChosenSkin[para1] = 120; SetPlayerSkin(para1, 120); }
					        else { return 1; }
							GetPlayerName(para1, giveplayer, sizeof(giveplayer));
							GetPlayerName(playerid, sendername, sizeof(sendername));
							PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
							PlayerInfo[para1][pRank] = 1;
							printf("News: %s has invited %s to join %s.", sendername, giveplayer, ftext);
							format(string, sizeof(string), "   You have Joined the %s, you were invited by Leader %s", ftext, sendername);
							SendClientMessage(para1, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "   You have Invited %s to join the %s.", giveplayer,ftext);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
							SetPlayerInterior(para1,0);
							new rand = random(sizeof(gInviteSpawns));
							SetPlayerPos(para1, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
							SetPlayerFacingAngle(para1, gInviteSpawns[rand][3]);
							SetPlayerCameraPos(para1,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
							SetPlayerCameraLookAt(para1,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
							TogglePlayerControllable(para1, 0);
						    SelectChar[para1] = 255;
						    SelectCharID[para1] = PlayerInfo[para1][pMember];
						    SelectCharPlace[para1] = 1;
						    PlayerInfo[para1][pModel] = ChosenSkin[para1];
					    	PlayerInfo[para1][pChar] = ChosenSkin[para1];
						    SendClientMessage(para1, COLOR_LIGHTRED, "* Use 'next' to Select the char you want to use.");
						    SendClientMessage(para1, COLOR_LIGHTRED, "* If you've found the Char you want to use, type 'done'.");
						}
						else
						{
						    SendClientMessage(playerid, COLOR_GREY, "  That player is currently Wanted / a Different Team / or already a Family Member.");
						    return 1;
						}
					}
				}//not connected
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command(leaders only)!");
			}
		}
		return 1;
	}


Imagini / Video (optional): Nu cred ca aveti nevoie.
Ati incercat sa rezolvati singur?:Da. La linia 2088 am asa "giveplayer " . In gamemode de unde am luat comanda am la "giveplayer " 

enum cCKInfo
{
	cSendername[20],
	cGiveplayer[20],
	cUsed,
};

 

Folosesc gamemode  http://www.sa-mp.ro/forums/topic/19086-mysql-r33-ideal-pentru-rpg/ . Si in "accounts.inc" am alea cu pInfo si am incercat sa adaug enum cCKInfo

cGiveplayer

cum e si mai sus si nu imi merge. Ce ar trebui sa-i fac?

Edited by Masodion
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

@DCosmin am rezolvat cu /invite, dar imi cere sa-mi aleg un skin. Am luat functiile din gamemode-ul ala si le-am facut ca sa mearga, si a trebuit sa fac si un public

 

public IsAtClothShop(playerid)
{
    if(IsPlayerConnected(playerid))
	{
        if(PlayerToPoint(25.0,playerid,20.5627,-103.7291,1005.2578) || PlayerToPoint(25.0,playerid,203.9068,-41.0728,1001.8047))
		{//Binco & Suburban
		    return 1;
		}
		else if(PlayerToPoint(30.0,playerid,214.4470,-7.6471,1001.2109) || PlayerToPoint(50.0,playerid,161.3765,-83.8416,1001.8047))
		{//Zip & Victim
		    return 1;
		}
	}
	return 0;
}

Insa primesc erori .

C:\Users\Mihai\Desktop\0\gamemodes\w3op.pwn(3274) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Mihai\Desktop\0\gamemodes\w3op.pwn(3278) : error 004: function "PlayerToPoint" is not implemented
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

 

 

linia 3274 :         

if(PlayerToPoint(25.0,playerid,20.5627,-103.7291,1005.2578) || PlayerToPoint(25.0,playerid,203.9068,-41.0728,1001.8047))

 

linia 3278         

		else if(PlayerToPoint(30.0,playerid,214.4470,-7.6471,1001.2109) || PlayerToPoint(50.0,playerid,161.3765,-83.8416,1001.8047))
		{//Zip & Victim
		    return 1;

Nu inteleg care ar fii erorile, playertopoint e implementat

 

#define PTP PlayerToPoint

forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);

 

Si atat am gasit in acel gm de playertopoint 

Link to comment
Share on other sites

  • 0

Verifica sa nu ai vreo acolada lipsa pe la ce ai modificat, si daca nu folosesti acel PTP, pune-l in comentariu, sau sterge-l.

Nu mai deschideti in pu*a mea servere de SA:MP !

Jucati-va pe cele care sunt !   Sunt suficiente !

Reguli de bun simt:

1. Nu faceti reclama unde nu trebuie !

2. Nu injurati ca la usa cortului !

3. Daca esti analfabeti, taci din gura !

4. Nu abuza de 'scuze', 'din greseala' !

 

My work ::: http://pastebin.com/VRNRcaAs

Link to comment
Share on other sites

  • 0

Foloseste IsPlayerInRangeOfPoint , aceasta este functia default de la SA:MP. PlayerToPoint nu iti functioneaza fiindca este un include pe care GM-ul tau nu il are ( cel mai probabil asta e ).

Intra pe link-ul de mai jos si uitate la parametrii apoi inlocuieste PlayertoPoint cu IsPlayerInRangeOfPoint.

https://wiki.sa-mp.com/wiki/IsPlayerInRangeOfPoint

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.