Jump to content

Comanda necunoscuta


Guest farse

Recommended Posts

Guest farse

[me=Tutorial facut la cerere : ]http://www.sa-mp.ro/forum/index.php/topic,13121.msg80863.html#msg80863 [/me]

1.Pentru comenzi obisnuite(OnPlayerCommandText)

Mergeti la functia OnPlayerCommandText si coborati pana unde este return 0; si adaugati,inainte de return 0, asta:

else
{
new Str[256];
format(Str,256,"EROARE:Comanda {204096}%s{962020} nu exista!Incercati /help si /cmds",cmdtext);
SendClientMessage(playerid,0x962020,Str);
return 1;
}
Apoi stergi return 0; si dai compile. ex:
public OnPlayerCommandText(playerid,cmdtext[])
{
	if(strcmp(cmdtext,"/test")==0)
	{
	    SendClientMessage(playerid,~0,"-");
		return 1;
	}
	//si alte sute de comenzi.
	else
	{
	new Str[256];
	format(Str,256,"EROARE:Comanda {204096}%s{962020} nu exista!Incercati /help si /cmds",cmdtext);
	SendClientMessage(playerid,0x962020,Str);
	return 1;
	}
}
2.Pentru ZCMD Cautati in mod functia OnPlayerCommandPerformed. DACA o gasiti,adaugati asta:
if(!success)
{
	new Str[256];
	format(Str,256,"EROARE:Comanda {204096}%s{962020} nu exista!Incercati /help si /cmds",cmdtext);
	SendClientMessage(playerid,0x962020,Str);
	return 1;
}
Daca nu o gasiti,inafara oricarei functii(de preferat...dupa OnPlayerSpawn-e o functie care o gasesti in mai toate modurile)pui asta:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if(!success)
	{
		new Str[256];
		format(Str,256,"EROARE:Comanda {204096}%s{962020} nu exista!Incercati /help si /cmds",cmdtext);
		SendClientMessage(playerid,0x962020,Str);
	}
	return 1;
}

Link to comment
Share on other sites

Guest farse

stuntman-=!!" post="80897" timestamp="1309338107"]

N-ai explicat nimic, doar, adauga, adauga, cauta, adauga ...

4/5

Crezi ca cineva ar citi si explicatiile?In 3-4 ani de cand is aici,am observat ca multi doar adauga unele lucruri,dau compile,si daca nu merge sar cu erorile,necitind si explicatiile.

Noh,si ce explicatii vrei?Cum se foloseste SendClientMessage,sau ce?

Nu e un tutorial complex despre cum se manipuleaza ceva,e doar un GM-ADDON

Link to comment
Share on other sites

  • 5 months later...
  • 1 year later...

[pawn]public OnPlayerCommandPerformed(playerid, cmdtext[], success)

{

if(!success)

{

new Str[256];

format(Str,256,"EROARE:Comanda {204096}%s{962020} nu exista!Incercati /help si /cmds",cmdtext);

SendClientMessage(playerid,0x962020,Str);

}

return 1;

}[/pawn]

cum as putea sa fa dilog boc msg

<a href="http://www.game-state.eu/188.212.105.161:7777/"><img src="http://www.game-state.eu/188.212.105.161:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

Link to comment
Share on other sites

[pawn]public OnPlayerCommandPerformed(playerid, cmdtext[], success)

{

if(!success)

{

new Str[256];

format(Str,256,"EROARE:Comanda {204096}%s{962020} nu exista!Incercati /help si /cmds",cmdtext);

SendClientMessage(playerid,0x962020,Str);

}

return 1;

}[/pawn]

cum as putea sa fa dilog boc msg

[pawn]public OnPlayerCommandPerformed ( playerid , cmdtext [ ] , success )

{

if ( !success )

{

new

                    string [ 256 ]

                ;

format ( string , 256 , "EROARE:Comanda {204096}%s{962020} nu exista!Incercati /help si /cmds" , cmdtext ) ;

ShowPlayerDialog ( playerid , 998 , DIALOG_STYLE_MSGBOX , "Comanda" , string , "O.K" , "" ) ;

}

return ( 1 ) ;

}[/pawn]

Link to comment
Share on other sites

multumesc mult ai +1 de ma mine

<a href="http://www.game-state.eu/188.212.105.161:7777/"><img src="http://www.game-state.eu/188.212.105.161:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.