Jump to content

Question

Posted

samp.ro

am comanda /star dar eu vreu sa fie comanda si la /lv3

am in cercat dar mia dat eror

se poate face pun aici scriptu?

#define FILTERSCRIPT//remember...this is a filterscript!!!

#include <a_samp>//you must have these include!

#if defined FILTERSCRIPT

#define COLOR_RED 0xAA3333AA//need to define this color for the STAR command
#define COLOR_BLUE 0x3A47DEFF//and this one for the dialog response negative

new Star;//names our pickup

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("       Find The Star - by GameR         ");//dont change theese
	print("--------------------------------------\n");
	return 1;
}


public OnFilterScriptExit()
{
	print("\n    <<<< Unloaded Star Minigame >>>>    \n");//the FilterScript was unloaded
	return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/star", cmdtext, true, 10) == 0)
	{
		if(IsPlayerAdmin(playerid)) {//veryfies if our player is an rcon admin
		ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"{FA0C0C}Star Command Panel", "{070FEF}Do you want to place a hidden {E8EF07}STAR{070FEF}\nhere for the event?", "Yes", "No");//the dialog
		} else {
		SendClientMessage(playerid, COLOR_RED, "Only an Admin can use this command.");//says to a normal player that just a rcon can use this commands
		}
		return 1;
	}
	if (strcmp("/scredits", cmdtext, true, 10) == 0)
	{
	    ShowPlayerDialog(playerid,33,DIALOG_STYLE_MSGBOX, "{F5ED06}Star{06F5DD} Minigame Credits", "{0639F5}Made by {06F50D}GameR","Ok","");//dont remove this line!!!!!!!!!!!!!!!!
		return 1;
	}
	return 0;
}


public OnPlayerPickUpPickup(playerid, pickupid)//when player enters pickup
{
    if(pickupid == Star){
    DestroyPickup(Star);//destroys the pickup
    new str[128];
    GetPlayerName(playerid, str, sizeof(str));//we get the winner name
    format(str, sizeof(str), "~R~ %s ~B~has found the ~N~hidden ~Y~Star", str);
    GameTextForAll(str,3000,1);//announce all who the winner is
   	print("\n------------Star Minigame Ended----------\n");
   	}
	return 1;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])//response to the dialg of /star
{
	if(dialogid == 10)
	{
		new Float:x, Float:y, Float:z;//defines our coordonates
		if(response)
		{
		GetPlayerPos(playerid, x, y, z);//takes the coordonates
		Star = CreatePickup(1247, 23, x+2, y, z);//places the pickup
 		SendClientMessage(playerid, COLOR_BLUE, "Pickup have been placed");//announcement
		} else {
	 	SendClientMessage(playerid, COLOR_BLUE, "Pickup haven't been placed");//announcement
	 	}
	}
	return 1;
}

#endif

//-----------------------------------------------THE END-----------------------------------------------//

5 answers to this question

Recommended Posts

Posted

=)) .

print("\n--------------------------------------");

print("      Find The Star - by GameR        ");//dont change theese

print("--------------------------------------\n");

Find The Star - By GameR ?

Find The Star - By ShOoBy .

Ma rog, nu asta conteaza suntem in [RO]

Zine ce admin sistem folosesti .

7bdea99b11.png

rimmon curv.

Posted

[pawn]dcmd_star(playerid,params[])

{

        if(PlayerInfo[playerid][Level] >= 3){//functie care verifica daca player-ul are level 3

ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"{FA0C0C}Star Command Panel", "{070FEF}Do you want to place a hidden {E8EF07}STAR{070FEF}\nhere for the event?", "Yes", "No");//the dialog

} else {

SendClientMessage(playerid, red, "Only an Admin Level 3 can use this command.");//functia care raspunde daca player-ul nu are level 3

}

return 1;[/pawn]

Partea cu raspunsul dialogului o faci singur ;)

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.