30.05.2016, 17:46
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(rid, playerid)
{
for(new rid = 0; rid < 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,playerid, params[])
{
new string[128], string2[128];
for(new rid = 0; rid < MAX_REQUEST ; rid++)
{
if(robpermission[playerid] == 0)
{
if(acceptedrob[playerid] == 1)
return SendClientMessage(playerid, WHITE, "Your request is already approved not needed to request again");
{
format(string, sizeof(string), "Your request has been sended to the online staff members");
SCM(playerid, YELLOW, string);
format(string2, sizeof(string2), "{FE2EC8}[Request] - {FFFFFF}%s has requested permission for a robbery [%d]", RPName(playerid), rid);
SendToMods(WHITE, string2);
robpermission[playerid] = 1;
}
}
}
return 1 ;
}