Raised This Month: $51 Target: $400
 12% 

Error with my store


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NWayne
Junior Member
Join Date: Aug 2017
Location: Warsaw, Europe
Old 09-15-2017 , 02:51   Error with my store
Reply With Quote #1

Hi Guys,

I want make my own store which will using credit's from Zephyrus's store. Please help me I don't know what's wrong is with my shop

Code:
Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <store>



public void OnPluginStart()
{
	RegConsoleCmd("sm_sklep", Menu_Sklep);
	RegAdminCmd("sm_vipsklep", Menu_VipSklep, ADMFLAG_CUSTOM1);
	RegConsoleCmd("sm_ocochodzi", Menu_OcoChodzi);

}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////PRE MENU/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
public Action Menu_Sklep(int client, int args)
{
	new Handle:menu = CreateMenu(sklepmenu, MenuAction:28);
	SetMenuTitle(menu, "Sklep By NWayne | HardStrike.EU");
	AddMenuItem(menu, "1", "Sklep");
	AddMenuItem(menu, "2", "Sklep dla VIP'a");
	AddMenuItem(menu, "3", "O co tu chodzi?");
	SetMenuExitButton(menu, true);
	DisplayMenu(menu, client, 250);
	return Plugin_Handled;
}

public sklepmenu(Handle:classhandle, MenuAction:action, client, Position) 
{ 
    if(action == MenuAction_Select) 
    { 
        new String:Item[32]; 
        GetMenuItem(classhandle, Position, Item, sizeof(Item)); 

        if(StrEqual(Item, "1")) 
        { 
        	SklepNorm(client, 0);
        } 
        if(StrEqual(Item, "2")) 
        { 
            FakeClientCommandEx(client, "sm_vipsklep"); 
        } 
        if(StrEqual(Item, "3")) 
        { 
            FakeClientCommandEx(client, "sm_ocochodzi"); 
        } 
    } 
    else if (action == MenuAction_End);
} 

////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////Normal Sklep//////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
public Action SklepNorm(int client, int args)
{
	Menu menu = CreateMenu(sklepgracza);
	menu.SetTitle("Sklep Gracza | HardStrike.EU")
	menu.AddItem("1", "+20HP [100 Credits]");
	menu.AddItem("2", "Predkosc [125 Credits]");
	menu.AddItem("3", "Grawitacja [200 Credits]");
	menu.AddItem("4", "Respawn [150 Credits]");
	menu.ExitButton = true;
	menu.Display(client, 60);
}

public sklepgracza(Menu menu, MenuAction action, int client, int Position)
{
	if(action == MenuAction_Select)
	{
      char Item[32]; 
        GetMenuItem(menu, Position, Item, sizeof(Item)); 
		
		if(StrEqual(Item, "1"))
		{
			 if (GetCredits > 150)
			 {
				if (!IsPlayerAlive(client) && GetClientTeam(client) > 1)
							{
								PrintToChat(client, "[SKLEP] Kupiles respawn. Baw się dobrze :D "); 
								CS_RespawnPlayer(client);
								Store_SetClientCredits(client, Store_GetClientCredits(client) -150);
							}
			  }
			  
			  else PrintToChat(client, "[SKLEP] Nie masz wystarczajacej ilosci kredytow"); 
		}
		if (StrEqual(Item, "2"));
		{
			
		}
		if (StrEqual(Item, "3"));
		{
			
		}
		if (StrEqual(Item, "4"));
		{
			
		}

	}
    else if (action == MenuAction_End);
		CloseHandle(sklepgracza, classhandle); 
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////VIP Sklep/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

public Action Menu_VipSklep(int client, int args)
{
	Menu menu = CreateMenu(sklepvip);
	menu.SetTitle("Sklep VIP'a | HardStrike.EU")
	menu.AddItem("1", "+20HP [100 Credits]");
	menu.AddItem("2", "Predkosc [125 Credits]");
	menu.AddItem("3", "Grawitacja [200 Credits]");
	menu.AddItem("4", "Respawn [150 Credits]");
	menu.ExitButton = true;
	menu.Display(client, 60);	
}


public sklepvip(Handle:classhandle, MenuAction:action, client, Position)
{


}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////Informacje///////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


public Action Menu_OcoChodzi(int client, int args)
{
	PrintToChat(client, "\x02 [SKLEP] \x04 ============================================== \x01");
	PrintToChat(client, "\x02 [SKLEP] \x04 W sklepie funkcjonuje waluta o nazwie kredyty.\x01");
	PrintToChat(client, "\x02 [SKLEP] \x04 Ilość swoich kredytów możesz sprawdzić pod komendą !credits. \x01");
	PrintToChat(client, "\x02 [SKLEP] \x04 Za kredyty możesz zakupić różne dodatki. Wszystkie dodatki są tylko na 1 runde \x01");
	PrintToChat(client, "\x02 [SKLEP] \x04 ============================================== \x01");
}
stock int GetCredits(int client)
{
  return  Store_GetClientCredits(client);
}

Error's:
Quote:
nwayne_sklep.sp
C:\Users\kordi\Desktop\nwayne_sklep.sp(50) : error 036: empty statement
C:\Users\kordi\Desktop\nwayne_sklep.sp(73) : warning 217: loose indentation
C:\Users\kordi\Desktop\nwayne_sklep.sp(75) : warning 217: loose indentation
C:\Users\kordi\Desktop\nwayne_sklep.sp(77) : error 100: function prototypes do not match
C:\Users\kordi\Desktop\nwayne_sklep.sp(8 : error 036: empty statement
C:\Users\kordi\Desktop\nwayne_sklep.sp(92) : error 036: empty statement
C:\Users\kordi\Desktop\nwayne_sklep.sp(96) : error 036: empty statement
C:\Users\kordi\Desktop\nwayne_sklep.sp(102) : warning 217: loose indentation
C:\Users\kordi\Desktop\nwayne_sklep.sp(102) : error 036: empty statement
C:\Users\kordi\Desktop\nwayne_sklep.sp(103) : warning 217: loose indentation
C:\Users\kordi\Desktop\nwayne_sklep.sp(103) : error 130: cannot coerce functions to values
C:\Users\kordi\Desktop\nwayne_sklep.sp(6) : warning 203: symbol is never used: "g_cvarChatTag"
ukonczone
NWayne is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 09-15-2017 , 04:41   Re: Error with my store
Reply With Quote #2

Comment out
Code:
if (StrEqual(Item, "2"));
		{
			
		}
		if (StrEqual(Item, "3"));
		{
			
		}
		if (StrEqual(Item, "4"));
		{
			
		}

Last edited by 8guawong; 09-15-2017 at 04:41.
8guawong is offline
NWayne
Junior Member
Join Date: Aug 2017
Location: Warsaw, Europe
Old 09-15-2017 , 05:31   Re: Error with my store
Reply With Quote #3

I mean

Quote:
if(StrEqual(Item, "1"))
{
if (GetCredits > 150)
{
if (!IsPlayerAlive(client) && GetClientTeam(client) > 1)
{
PrintToChat(client, "[SKLEP] Kupiles respawn. Baw się dobrze ");
CS_RespawnPlayer(client);
Store_SetClientCredits(client, Store_GetClientCredits(client) -150);
}
}

else PrintToChat(client, "[SKLEP] Nie masz wystarczajacej ilosci kredytow");
}
it doesn't work

Last edited by NWayne; 09-15-2017 at 05:34.
NWayne is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 09-15-2017 , 06:18   Re: Error with my store
Reply With Quote #4

You need to pass client to your function/stock
So if (GetCredits(client) > 150)
8guawong is offline
NWayne
Junior Member
Join Date: Aug 2017
Location: Warsaw, Europe
Old 09-15-2017 , 10:32   Re: Error with my store
Reply With Quote #5

Quote:
Originally Posted by 8guawong View Post
You need to pass client to your function/stock
So if (GetCredits(client) > 150)
Last question i've got
Quote:
}
}
else if (action == MenuAction_End);
}
and..


Code:
C:\Users\KORDIAN\Downloads\nwayne_sklep.sp(133) : warning 217: loose indentation
C:\Users\KORDIAN\Downloads\nwayne_sklep.sp(133) : error 036: empty statement
What's wrong is it ?

Last edited by NWayne; 09-15-2017 at 10:32.
NWayne is offline
fiction
Member
Join Date: May 2017
Old 09-15-2017 , 10:55   Re: Error with my store
Reply With Quote #6

Quote:
Originally Posted by NWayne View Post
What's wrong is it ?
PHP Code:
else if(action == MenuAction_End)
{
    
CloseHandle(classhandle);

fiction is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode