Keeps returning on "0"
#1

I've created this command for a rob system, But the Request ID keeps returing on 0 can someone help me out?

PHP код:
#define MAX_REQUEST 20
enum Mreq
{
    
RName,
     
Reqid,
     
Requestedrob,
};
new 
Reqrobbery[MAX_REQUEST][Mreq];
stock RequestRobberId(ridplayerid)
{
    for(new 
rid 0rid MAX_REQUEST rid++)
    {
        if(
Reqrobbery[rid][requestedrob] == 0)
        {
            
Reqrobbery[rid][RName] = RPName(playerid);
            
Reqrobbery[rid][Reqid] = rid;
            
Reqrobbery[rid][Requestedrob] = 1;
            return 
1;
        }
    }
    return 
0;
}
command(requestrob,playeridparams[])
{
    new 
string[128], string2[128];
    
    for(new 
rid 0rid MAX_REQUEST rid++)
     {
        if(
robpermission[playerid] == 0)
        {
            if(
acceptedrob[playerid] == 1)
                return 
SendClientMessage(playeridWHITE"Your request is already approved not needed to request again");
            {
                
format(stringsizeof(string), "Your request has been sended to the online staff members");
                
SCM(playeridYELLOWstring);
                
format(string2sizeof(string2), "{FE2EC8}[Request] - {FFFFFF}%s has requested permission for a robbery [%d]"RPName(playerid), rid);
                
SendToMods(WHITEstring2);
                
robpermission[playerid] = 1;
            }
        }
    }
    return 
;
 } 
Reply
#2

The stock says "return 0" and you wonder why it returns 0

?
Reply
#3

Quote:
Originally Posted by justjamie
Посмотреть сообщение
The stock says "return 0" and you wonder why it returns 0

?
Even when i removed that it keeps returning as 0
Reply
#4

Bump.
Reply
#5

Well...you do crazy stuff...

For example...in your command:

PHP код:
for(new rid 0rid MAX_REQUEST rid++) 
this loop...can u explain..this non sense?

and you never call
PHP код:
RequestRobberId 
and wonder...why this is never set?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)