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 1: temp = "my text"
case 2: temp = "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 1: temp = "my text"
case 2: temp = "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 x = 1; x <= get_maxplayers(); x++)
if(cs_get_user_team(x) > 1)
players[num++] = x
return (num == 0) ? - 1 : players[random_num(0, num - 1)]
}
it kept saying that it must be a constant, which does not happen on sourcepawn. ty.