Command Problem
#1

For some reason it shows "SERVER: Unknown Command" randomly. I see no bugs or anything on the code
pawn Код:
CMD:quitjob(playerid,params[])
{
    if(PlayerData[playerid][Job] == 0) return SCM(playerid,red,"ERROR: You are not in a job");
    format(str,sizeof(str),"You have quitted %s",JobInfo[PlayerData[playerid][Job]][Jobname]);
    SCM(playerid,COLOR_LIGHTBLUE,str);
    PlayerData[playerid][Job] = 0;
    return 1;
}
Reply
#2

Don't get mad to me, but just asking. I see only once the "if" for checking if they have a job... Should you do it twice? In my eyes, i just keep staring at the miss of that. :/

What i'm talking about is
pawn Код:
if(PlayerData[playerid][Job] == 1)

Just trying to be kind and help. Hopefully it helps...
Reply
#3

Hey Da' J' in this case a 'if' statement is only used once as your only checking if the players job is 0 which would be no job understand? But your right alot of cases where this would be used.
Reply
#4

Weird, maybe a bug else
Reply
#5

Quote:
Originally Posted by Da' J'
Посмотреть сообщение
Don't get mad to me, but just asking. I see only once the "if" for checking if they have a job... Should you do it twice? In my eyes, i just keep staring at the miss of that. :/

What i'm talking about is
pawn Код:
if(PlayerData[playerid][Job] == 1)

Just trying to be kind and help. Hopefully it helps...
Nah, doing
pawn Код:
if(PlayerData[playerid][Job] == 0) return SomeErrorMsg
is the equivalent of doing
pawn Код:
if(PlayerData[playerid][Job] != 0)
{
    //we continue with our command
}

How is your
pawn Код:
JobInfo[PlayerData[playerid][Job]][Jobname]
set?
Reply
#6

Well JobInfo[PlayerData[playerid][Job]][Jobname] shows what job is the player in. Im sure that has no problem because it works for other commands.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)