Keeps returning on "0" - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Keeps returning on "0" (
/showthread.php?tid=608325)
Keeps returning on "0" -
lulo356 - 30.05.2016
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 ;
}
Re: Keeps returning on "0" -
justjamie - 30.05.2016
The stock says "return 0" and you wonder why it returns 0
?
Re: Keeps returning on "0" -
lulo356 - 30.05.2016
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
Re: Keeps returning on "0" -
lulo356 - 31.05.2016
Bump.
Re: Keeps returning on "0" -
Kaliber - 31.05.2016
Well...you do crazy stuff...
For example...in your command:
PHP код:
for(new rid = 0; rid < MAX_REQUEST ; rid++)
this loop...can u explain..this non sense?
and you never call
and wonder...why this is never set?