Need help and input on errors!
#1

I am coding my own vehicle system, and i keep getting 2 index errors or somthing... i need ot know what im doing wrong........ heres the error and the code that it is showing fo the errors...

I put:

cmd = strtok(cmdtext, idx);

resulting in the error: error 033: array must be indexed (variable "cmd")

then: tmp = strtok(cmdtext, idx)

resulting in the error: error 033: array must be indexed (variable "tmp")


Thanks ahead of time for any help given
Reply
#2

cmd and tmp need to be strings:
pawn Код:
new tmp[255]; //255 is dependent to size in strtok
new cmd[255];
or you don't have strtok in your script.
Reply
#3

i have it as this

public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new string[256];
new cmd[256];
new tmp[256];
new sendername[MAX_PLAYER_NAME];
cmd = strtok (cmdtext, idx);
new vehid = GetPlayerVehicleID(playerid);
if(strcmp(cmd,"/car",true)==0)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playernam e));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_WHITE,"Need vehicle ownership help? Type: /car help");
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)