Raised This Month: $ Target: $400
 0% 

couple questions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
0x00
SourceMod Donor
Join Date: Oct 2010
Location: #!/usr/bin/0x00
Old 12-01-2010 , 18:56   couple questions
Reply With Quote #1

first of, whats wrong with the following check:

PHP Code:
public function(id)
    if(
cs_get_user_team(id) < 2)
        
// something 
the syntax of such native is pretty simple, i really can't see any mistake. anyway, in sourcepawn you could do the following:

PHP Code:
new string:temp[1024]

public function()
    switch(
something)
    {
        case 
1temp "my text"
        
case 2temp "my text 2"

        
// and so on
    

but you can't do the following on amxx, so please, tell me whats wrong.

PHP Code:
new temp[1024]

public function()
    switch(
something)
    {
        case 
1temp "my text"
        
case 2temp "my text 2"

        
// and so on
    

and the last question, whats wrong with:

PHP Code:
get_randplayer()
{
    
/*
    using get_players() because i really don't
    need to do any check, like teams, etc. so get_maxplayers()
    isnt really needed.
    */

    
new players[get_players() + 1], num
    
    
for(new 1<= get_maxplayers(); x++)
        if(
cs_get_user_team(x) > 1)
            
players[num++] = x
            
    
return (num == 0) ? - players[random_num(0num 1)]

it kept saying that it must be a constant, which does not happen on sourcepawn. ty.

Last edited by 0x00; 12-01-2010 at 18:58. Reason: fixed a typo
0x00 is offline
 



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 11:26.


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