Urgent HELP! Error 33 array must be indexed(variable "cmd" and "tmp"
#1

Lines 110 and 114

new cmd[128],idx;
cmd = strtok(cmdtext,idx); LINE 110
if(strcmp(cmd,"/tele",true)==0)
{
new tmp[128];
tmp = strtok(cmdtext,idx); LINE 114
if(strlen(tmp)==0) return SendClientMessage(playerid,BLUE,"Usage: /tele 1");
if(strval(tmp)==1)
SetPlayerPos(playerid,1885.7004,-2592.2048,13.5469);


Error 33 array must be indexed(variable "cmd" and "tmp"
Reply
#2

Help Please
Reply
#3

new cmd[128];
cmd=strtok(cmdtext,index);
if(strcmp(cmd, "/tele", true)== 0)
{
new tmp[128];
tmp=strtok(cmdtext,index);
if(strlen(tmp)==0) return SendClientMessage(playerid,BLUE,"Usage: /tele 1");
if(strval(tmp)==1)
SetPlayerPos(playerid,1885.7004,-2592.2048,13.5469);

try that
Reply
#4

error 33 array must be indexed(variables cmd) line 109
error 33 array must be indexed(variables tmp)line 113


new cmd[128],index;
cmd = strtok(cmdtext,index); LINE 109
if(strcmp(cmd,"/tele",true)==0)
{
new tmp[128];
tmp=strtok(cmdtext,index); LINE 113
if(strlen(tmp)==0) return SendClientMessage(playerid,BLUE,"Usage: /tele 1");
if(strval(tmp)==1)
SetPlayerPos(playerid,1885.7004,-2592.2048,13.5469);
return 1;
Reply
#5

I had to do #include index but now its saying
cannot read from file: "index"
how to do a file for it?
Reply
#6

Hold on. If you are doing /tele command why don't you do this
Code:
CMD:tele(playerid, params[])
{
    SetPlayerPos(playerid,1885.7004,-2592.2048,13.5469);
    return 1;
}
I don't have time to enter all what you need. But you get the point
Reply
#7

Come on man!
Reply
#8

Hey yo it's you on samp script gamemode server im interested

and have you do:
Code:
#include <ZCMD>
on the top of your pawn script ?
Have you download zcmd and he is in pawno/include ?
and what is line 106 and 110 ?
Reply
#9

1. start using a command processor
2. if you post code use [php]
3. dont bump your post so fast
4. works totally fine ... :

PHP Code:
    new cmd[128],idx;
    
cmd strtok(cmdtext,idx);
    if(
strcmp(cmd,"/tele",true)==0)
    {
        new 
tmp[128];
        
tmp strtok(cmdtext,idx);
        if(
strlen(tmp)==0) return SendClientMessage(playerid,BLUE,"Usage: /tele 1");
        if(
strval(tmp)==1)
        
SetPlayerPos(playerid,1885.7004,-2592.2048,13.5469);
    } 
Reply
#10

Marcel said some truth. Please read it...
And this command works perfectly.
PHP Code:
public OnPlayerCommandText(playeridcmdtext[])
{
    new 
cmd[128],idx;
    
cmd strtok(cmdtext,idx);
    if(
strcmp(cmd,"/tele",true)==0)
    {
        new 
tmp[128];
        
tmp strtok(cmdtext,idx);
        if(
strlen(tmp)==0) return SendClientMessage(playerid,BLUE,"Usage: /tele 1");
        if(
strval(tmp)==1)
        
SetPlayerPos(playerid,1885.7004,-2592.2048,13.5469);
        return 
1;
    }
    return 
0;

5. We aren't here to create some stuff for you, we are here to help you create some stuff when you are stuck in your development.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)