SA-MP Forums Archive
[CMD] - SERVER: Unknown command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [CMD] - SERVER: Unknown command (/showthread.php?tid=611533)



[CMD] - SERVER: Unknown command - Maximun - 07.07.2016

Well, in the CMD everything is working fine just one thing, once the pickup create it appears 'SERVER: Unknown command.' is that normal?

PHP код:
CMD:createpickupjob(playeridparams[])
{
    for(new 
0sizeof(InfoTextDrawJob); r++)
    {
        new 
idpickupjobtype[64], nivrequisvwtd=-1INTTDPick;
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        if(
sscanf(params,"isii"idpickupjobtypenivrequisINTTDPick)) return SendClientMessage(playerid, -1,"[CMD]: /createpickupjob [IDPickup] [Job] [Niv] [PickupINT]");
        
CreateDynamicPickup(idpickup1xyzvwtd);
        
InfoTextDrawJob[r][LevelRQ] = nivrequis;
        
InfoTextDrawJob[r][InTextX] = x;
        
InfoTextDrawJob[r][InTextY] = y;
        
InfoTextDrawJob[r][InTextZ] = z;
        
InfoTextDrawJob[r][IDPickup] = idpickup;
        
InfoTextDrawJob[r][PickupVW] = vwtd;
        
InfoTextDrawJob[r][PickupINT] = INTTDPick;
        new 
query[450];
        
mysql_format(g_iHandlequerysizeof(query), "INSERT INTO `srv_td_job` (`InTextX` ,`InTextY`,`InTextZ`) VALUES (%f, %f, %f)"xyz);
        
mysql_tquery(g_iHandlequery);
        break;
            
    }
    return 
1;

The problem is only in the CMD, the others commands is working without the message.


Re: [CMD] - SERVER: Unknown command - Doudou - 07.07.2016

Try to replace 'break;' with 'return 1;'.


Re: [CMD] - SERVER: Unknown command - iKarim - 07.07.2016

Quote:
Originally Posted by Doudou
Посмотреть сообщение
Try to replace 'break;' with 'return 1;'.
what

Ontopic:

Try using crashdetect, it would tell us if there's a crash. What just came in my mind is that loop crashing because it tries to access an index which is out of range.


Re: [CMD] - SERVER: Unknown command - Maximun - 07.07.2016

Quote:
Originally Posted by Doudou
Посмотреть сообщение
Try to replace 'break;' with 'return 1;'.
The same problem

Quote:
Originally Posted by PawnHunter
Посмотреть сообщение
Try using crashdetect, it would tell us if there's a crash. What just came in my mind is that loop crashing because it tries to access an index which is out of range.
No result


Re: [CMD] - SERVER: Unknown command - Maximun - 07.07.2016

Anyone please?


Re: [CMD] - SERVER: Unknown command - Dayrion - 07.07.2016

Put some print to debug your command.
Question, why have you a sscanf line in your loop?


Re: [CMD] - SERVER: Unknown command - Maximun - 07.07.2016

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Put some print to debug your command.
Question, why have you a sscanf line in your loop?
Well I'll put some print, do you mean sscanf must be above the loop?

Edit: after trying with print there's no result, I see only the print :
[21:49:58] Command successful
No others things


Re: [CMD] - SERVER: Unknown command - Dayrion - 07.07.2016

Your command mean nothing. Why have you a loop?
Try this :
PHP код:
CMD:createpickupjob(playeridparams[]) 
{
    print(
"Starting command...")
    new 
idpickupjobtype[64], nivrequisvwtd=-1INTTDPick
    new 
Float:xFloat:yFloat:z
    
GetPlayerPos(playeridxyz); 
    if(
sscanf(params,"isii"idpickupjobtypenivrequisINTTDPick)) return SendClientMessage(playerid, -1,"[CMD]: /createpickupjob [IDPickup] [Job] [Niv] [PickupINT]"); 
    
CreateDynamicPickup(idpickup1xyzvwtd); 
    
printf("nivrequis: %i | x:%.2f | y:%.2f | z:%.2f | idpickup : %i | vwtd : %i | INTTDPick : %i"nivrequisxyzidpickupvwtdINTTDPick);
    
InfoTextDrawJob[r][LevelRQ] = nivrequis
    
InfoTextDrawJob[r][InTextX] = x
    
InfoTextDrawJob[r][InTextY] = y
    
InfoTextDrawJob[r][InTextZ] = z
    
InfoTextDrawJob[r][IDPickup] = idpickup
    
InfoTextDrawJob[r][PickupVW] = vwtd
    
InfoTextDrawJob[r][PickupINT] = INTTDPick
    new 
query[450]; 
    print(
"Saving MYQSL params")
    
mysql_format(g_iHandlequerysizeof(query), "INSERT INTO `srv_td_job` (`InTextX` ,`InTextY`,`InTextZ`) VALUES (%f, %f, %f)"xyz); 
    
mysql_tquery(g_iHandlequery); 
    return 
1




Re: [CMD] - SERVER: Unknown command - Maximun - 07.07.2016

@Dayrion Just tried, but no result it always show the message

Code:
PHP код:
CMD:createpickupjob(playeridparams[])
{
    print(
"Starting command...");
    new 
idpickupjobtype[64], nivrequisvwtd=-1INTTDPick;
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    if(
sscanf(params,"isii"idpickupjobtypenivrequisINTTDPick)) return SendClientMessage(playerid, -1,"[CMD]: /createpickupjob [IDPickup] [Job] [Niv] [PickupINT]");
    
CreateDynamicPickup(idpickup1xyzvwtd);
    
printf("nivrequis: %i | x:%.2f | y:%.2f | z:%.2f | idpickup : %i | vwtd : %i | INTTDPick : %i"nivrequisxyzidpickupvwtdINTTDPick);
    new 
query[450];
    print(
"Saving MYQSL params");
    
mysql_format(g_iHandlequerysizeof(query), "INSERT INTO `srv_td_job` (`InTextX` ,`InTextY`,`InTextZ`) VALUES (%f, %f, %f)"xyz);
    
mysql_tquery(g_iHandlequery);
    return 
1;

Logs:
Код:
[23:42:51] Starting command...
[23:42:57] Starting command...
[23:42:57] nivrequis: 1 | x:1848.79 | y:-1814.41 | z:3.98 | idpickup : 1239 | vwtd : -1 | INTTDPick : 0
[23:42:57] Saving MYQSL params



Re: [CMD] - SERVER: Unknown command - Maximun - 08.07.2016

No one please??