Dcmd return 0;
#1

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(racecmds,8,cmdtext);
    dcmd(racelist,8,cmdtext);
    dcmd(buildcmds,9,cmdtext);
    dcmd(buildrace,9,cmdtext);
    dcmd(cp,2,cmdtext);
    dcmd(scp,3,cmdtext);
    dcmd(rcp,3,cmdtext);
    dcmd(mcp,3,cmdtext);
    dcmd(dcp,3,cmdtext);
    dcmd(clearrace,9,cmdtext);
    dcmd(editrace,8,cmdtext);
    dcmd(saverace,8,cmdtext);
    dcmd(setlaps,7,cmdtext);
    dcmd(racemode,8,cmdtext);
    dcmd(loadrace,8,cmdtext);
    dcmd(startrace,9,cmdtext);
    dcmd(join,4,cmdtext);
    dcmd(leave,5,cmdtext);
    dcmd(endrace,7,cmdtext);
    dcmd(ready,5,cmdtext);
    dcmd(bestlap,7,cmdtext);
    dcmd(bestrace,8,cmdtext);
    dcmd(deleterace,10,cmdtext);
    dcmd(airrace,7,cmdtext);
    dcmd(cpsize,6,cmdtext);
    dcmd(prizemode,9,cmdtext);
    dcmd(setprize,8,cmdtext);
    dcmd(raceadmin,9,cmdtext);
    dcmd(buildmenu,9,cmdtext);
    new string[256];
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
    new tmp[256];
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new giveplayerid;
    new idcar = GetPlayerVehicleID(playerid);
return 0;
}
This crashes my pawno program, even if i place the return 0 above the new string.
Reply
#2

Try put the all the
pawn Код:
new
things on top of dcmd, Idk
Reply
#3

Nah
Reply
#4

You don't need all these variables and arrays in the OnPlayerCommandText callback, delete them.
Reply
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    //new string[256];
    //new cmd[256];
    //new idx;
    //new tmp[256];
    //new sendername[MAX_PLAYER_NAME];
    //new giveplayer[MAX_PLAYER_NAME];
    //new giveplayerid;
    //new idcar = GetPlayerVehicleID(playerid);
    //cmd = strtok(cmdtext, idx);
    dcmd(racecmds,8,cmdtext);
    dcmd(racelist,8,cmdtext);
    dcmd(buildcmds,9,cmdtext);
    dcmd(buildrace,9,cmdtext);
    dcmd(cp,2,cmdtext);
    dcmd(scp,3,cmdtext);
    dcmd(rcp,3,cmdtext);
    dcmd(mcp,3,cmdtext);
    dcmd(dcp,3,cmdtext);
    dcmd(clearrace,9,cmdtext);
    dcmd(editrace,8,cmdtext);
    dcmd(saverace,8,cmdtext);
    dcmd(setlaps,7,cmdtext);
    dcmd(racemode,8,cmdtext);
    dcmd(loadrace,8,cmdtext);
    dcmd(startrace,9,cmdtext);
    dcmd(join,4,cmdtext);
    dcmd(leave,5,cmdtext);
    dcmd(endrace,7,cmdtext);
    dcmd(ready,5,cmdtext);
    dcmd(bestlap,7,cmdtext);
    dcmd(bestrace,8,cmdtext);
    dcmd(deleterace,10,cmdtext);
    dcmd(airrace,7,cmdtext);
    dcmd(cpsize,6,cmdtext);
    dcmd(prizemode,9,cmdtext);
    dcmd(setprize,8,cmdtext);
    dcmd(raceadmin,9,cmdtext);
    dcmd(buildmenu,9,cmdtext);
return 0;
}
Like this Don? It still crashes
Reply
#6

The source of the crash might not be in your OnPlayerCommandText callback,
Most of the time its caused by a bracket somewhere on your script
Reply
#7

Quote:
Originally Posted by JoeDaDude
Try put the all the
pawn Код:
new
things on top of dcmd, Idk
If you don't know.. Don't post.



Quote:
Originally Posted by Don Correlli
You don't need all these variables and arrays in the OnPlayerCommandText callback, delete them.
Doesn't matter.





Show the whole callback.
Reply
#8


Show the whole callback.
[/quote]
Hi, what do you mean with callback? hope that you can help me
Reply
#9

He means the whole of your OnPlayerCommandText,

Quote:
Originally Posted by JoeDaDude
The source of the crash might not be in your OnPlayerCommandText callback,
Most of the time its caused by a bracket somewhere on your script
Reply
#10

Thats like 20k+ lines
I'll paste my dcmd lines as they are the bottom in my script maybe that would help
http://pastebin.com/f180b206c
Could it be this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)