Command doesnt work (rewritten the code)
#1

Hello.
It shows "UNKNOWN COMMAND" when i run this.

Command:
PHP код:
COMMAND:temp(playerid,params[])
{
new 
query[420];
format(query,sizeof(query),"SELECT * FROM vehicles where owner='%s'",PlayerName(playerid));
mysql_function_query(dbhandle,query,true,"OnCarSpawnCommand","i",playerid);

function
PHP код:
forward OnCarSpawnCommand(playerid);
public 
OnCarSpawnCommand(playerid)
{
new 
num_fields2,num_rows2;
new
    
string2 500 ],
    
string  500 ],
    
string1337[420],
    
temp_carowner[35];
cache_get_data(num_rows2,num_fields2,dbhandle);
if(
num_rows2!=0)
{
for(new 
0sizeof(cInfo); v++)
{
        
cache_get_field_content(v"owner"temp_carowner);
        
format(string1337,sizeof(string1337),"%s",temp_carowner);
        
myStrcpy(cInfo[v][carowner], string1337);
 if(
strcmp(cInfo[v][carowner], PlayerName(playerid), true))
 {
    
format(string2sizeof(string2), "%i (%i)\n"cInfo[v][carmodelid],cInfo[v][db_id]);
    
strcat(stringstring2);
 }
}
  
ShowPlayerDialog(playerid,DIALOG_CARSPAWN,DIALOG_STYLE_LIST,"Car spawning",string,"Spawn","Close");
}
return 
1;

What's the matter here?
Reply
#2

nobody an idea?
Reply
#3

PHP код:
COMMAND:temp(playerid,params[]) 

new 
query[420]; 
format(query,sizeof(query),"SELECT * FROM vehicles where owner='%s'",PlayerName(playerid)); 
mysql_function_query(dbhandle,query,true,"OnCarSpawnCommand","i",playerid); 

you miss return 1; should be:
PHP код:
COMMAND:temp(playerid,params[]) 

new 
query[420]; 
format(query,sizeof(query),"SELECT * FROM vehicles where owner='%s'",PlayerName(playerid)); 
mysql_function_query(dbhandle,query,true,"OnCarSpawnCommand","i",playerid); 
return 
1;

Reply
#4

PHP код:
COMMAND:temp(playerid,params[]) 

new 
query[420]; 
format(query,sizeof(query),"SELECT * FROM vehicles where owner='%s'",PlayerName(playerid)); 
mysql_function_query(dbhandle,query,true,"OnCarSpawnCommand","i",playerid); 
return 
1;

Reply
#5

welp very smart of me xd
Reply
#6

Now the unknown command is gone, but it doesn't load anything nonetheless.
help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)