Making a Menu, That Gives a Fightstyle & Takes Money - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Making a Menu, That Gives a Fightstyle & Takes Money (
/showthread.php?tid=326581)
Making a Menu, That Gives a Fightstyle & Takes Money -
NoZ - 17.03.2012
Hey Guys, I'm Tryying to Complete a Menu for Los Santos Gym.
Now...
Ive Created the Menu
Код:
Learn = CreateMenu("Ganton Gym", 2, 400.0, 400.0, 150.0, 150.0);
AddMenuItem(Learn, 1, "Default Style - $500");
AddMenuItem(Learn, 1, "Kick Boxing Style - $1250");
AddMenuItem(Learn, 1, "Brawling Style - $2250");
AddMenuItem(Learn, 1, "Grab & Kick Style - $2850");
AddMenuItem(Learn, 1, "Grab & Knee Style - $3000");
AddMenuItem(Learn, 1, "Kung-Fu Style - $3250");
Then After ive Created That, ive Gone onto a Infomation Icon in the LS Gym.
Then After that I Needed to add a Command on(within Range) of the Infomation Icon
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Learn",cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,3.0, 771.1017, 12.5446, 1000.7006))
{
ShowMenuForPlayer(Learn, playerid);
return 1;
}
}
return 0;
}
Then Ive Created what Happen on the Selection of Menus
Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);if(CurrentMenu == Learn)
{
switch(row)
{
case 0: //Normal Style - $500
{
if(GetPlayerMoney(playerid) < 499)
{
GivePlayerMoney(playerid, -500);
SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Finished! ~n~~y~] ] ]",10000,3);
SendClientMessage(playerid, 0xFFFFFFFF, "---------------------------------");
SendClientMessage(playerid, 0xFFFFFFFF, "- [[Certificate of Achievement]] -");
SendClientMessage(playerid, 0xFFFFFFFF, "- Normal Fighting Style -");
SendClientMessage(playerid, 0xFFFFFFFF, "---------------------------------");
}
}
case 1:
{
//Needs Coding
}
case 2:
{
//Needs Coding
}
case 3:
{
//Needs Coding
}
case 4:
{
//Needs Coding
}
case 5:
{
//Needs Coding
}
}
}
return 1;
}
But, Somthing's Not Right.
Why? What am i Doing Wronge, this going based of my own experince & and a tiny help from website, im tryna code without looking at websites so much so i learn by myself (best way i learn)
could anyone help me?
what am i doing wronge?
EDIT: I get no errors.
Re: Making a Menu, That Gives a Fightstyle & Takes Money -
semaj - 18.06.2013
whats not working on it? if you get no error's?