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

a few questions (CS:S)


Post New Thread Reply   
 
Thread Tools Display Modes
ojmdk476oj
AlliedModders Donor
Join Date: Dec 2009
Old 07-07-2011 , 19:50   Re: a few questions (CS:S)
Reply With Quote #11

As far as i remember you spawn when you also "spawn" when you join spec, that could be it?
ojmdk476oj is offline
stas3
Junior Member
Join Date: Jul 2011
Location: ukraine
Old 07-07-2011 , 20:35   Re: a few questions (CS:S)
Reply With Quote #12

Question about PrintToChat resolved.
__________________
My English is bad
stas3 is offline
SideX
Senior Member
Join Date: Jun 2010
Location: Ukraine, Melitopol.
Old 07-08-2011 , 03:50   Re: a few questions (CS:S)
Reply With Quote #13

Use search.
http://forums.alliedmods.net/showthr...weapons+ground
SideX is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 07-08-2011 , 05:02   Re: a few questions (CS:S)
Reply With Quote #14

native FindEntityByClassname(startEnt, const String:classname[]);

search for functions here http://docs.sourcemod.net/api/
and for tutorials http://wiki.alliedmods.net/Category:SourceMod_Scripting
Despirator is offline
stas3
Junior Member
Join Date: Jul 2011
Location: ukraine
Old 07-09-2011 , 23:13   Re: a few questions (CS:S)
Reply With Quote #15

If I want to keep certain information to the players how to do it in SourcePawn? In Eventscripts can save and load the dictionary with the help of cPickle. You must use SQL + php? What are my options?
__________________
My English is bad
stas3 is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-12-2011 , 18:24   Re: a few questions (CS:S)
Reply With Quote #16

Look at clientprefs.inc. That uses mysql to store keys per-client. The client sets up their database info in their sourcemod configs.
__________________
Greyscale is offline
stas3
Junior Member
Join Date: Jul 2011
Location: ukraine
Old 07-14-2011 , 01:33   Re: a few questions (CS:S)
Reply With Quote #17

Please give a small example of how to create a structure:

PHP Code:
"MyFile"
{
    
"STEAM_0:0:7"
    
{
        
"name"    "crab"
    
}

Because in wiki is really not enough examples.

How to do it, I realized:

PHP Code:
"MyFile"
{
    
"STEAM_0:0:7"    "crab"

I know keygroup in Eventscripts and thought learn keyvalues will be easier. Please give this example.

------

And another question about keyvalues. Written: "The Handle must always be closed.". It does not mean you have to do CloseHandle() in the same function, where we did CreateKeyValues() ? I just want to get information in the event OnClientPutInServer, but CreateKeyValues -> in OnMapStart, CloseHandle() in OnMapEnd. And 'Handle to a new KeyValues structure' = global variable.
__________________
My English is bad

Last edited by stas3; 07-14-2011 at 02:29.
stas3 is offline
stas3
Junior Member
Join Date: Jul 2011
Location: ukraine
Old 07-16-2011 , 07:27   Re: a few questions (CS:S)
Reply With Quote #18

I still have not figured out how to create such a structure. But I have another question:

Is there a difference between these two options?

1.

PHP Code:
new player_team[MAXPLAYERS+1];

// and when player_spawn:

player_team[client] = GetClientTeam(client);

public 
OnGameFrame()
{
    for (new 
1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i) || !IsPlayerAlive(i)) continue;
        if (
player_team[i] == CS_TEAM_T)
        {
            
// code
        
}
    }

2.

PHP Code:
public OnGameFrame()
{
    for (new 
1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i) || !IsPlayerAlive(i)) continue;
        if (
GetClientTeam(i) == CS_TEAM_T)
        {
            
// code
        
}
    }

It seems to me that the first option better, since too often do not have to do GetClientTeam(). Or does it not matter?

- Thanks for your help
__________________
My English is bad
stas3 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 09:41.


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