SA-MP Forums Archive
Unknown Command problem. - 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: Unknown Command problem. (/showthread.php?tid=395809)



Unknown Command problem. - CrazyManiac - 27.11.2012

Hello everyone. I have made the following command:

Код:
COMMAND:login(playerid,params[])
{
    if(isnull(params)) return NoSuccess(playerid,"Usage: /login <password>");
    format(str,256,"%s.txt",pname[playerid]);
    if(!dini_Exists(str)) return NoSuccess(playerid,"[Notification] You did not Register yet. Please use /register <password> to Register a new account!");
    if(Login[playerid] == 1) return NoSuccess(playerid,"[Notification] You have already been logged in!");
    if(strcmp(params,ReturnPasswort(pname[playerid]),false)) return NoSuccess(playerid,"[Notification] You have     entered an invalid password!");
    
    LoadPlayer(playerid);
    Login[playerid] = 1;
    SendClientMessage(playerid,neongruen,"[Notification] You have successfully been logged in!");
    return 1;
}
But, when i try using /login OR /login <my password>, it says "Unknown Command". Is it because of my command,
Or is it because of something else?

Please help me. Thanks.

Greetings, CrazyManiac.



AW: Unknown Command problem. - Skimmer - 27.11.2012

I don't see any problem there, you use zcmd there, remove the public OnPlayerCommandText script in your script, compile then try again.


Re: Unknown Command problem. - CrazyManiac - 28.11.2012

It doesn't has one. Also, this is my OnPlayerCommandPerformed.

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if(success)
	{
	    printf("[COMMAND] Command %s from %s was successfully loaded.",cmdtext,pname[playerid]);
	}
	else
	{
	    printf("[CMD] Command %s from %s was »not« successfully loaded.",cmdtext,pname);

	    format(str,144,"[Notification] That Command does not exists. Please re-try, or use /help.",cmdtext);
	    NoSuccess(playerid,str);
	}
	return 1;
}
Can someone help me out?


Re: Unknown Command problem. - CrazyManiac - 28.11.2012

Quote:
Originally Posted by CrazyManiac
Посмотреть сообщение
Hello everyone. I have made the following command:

Код:
COMMAND:login(playerid,params[])
{
    if(isnull(params)) return NoSuccess(playerid,"Usage: /login <password>");
    format(str,256,"%s.txt",pname[playerid]);
    if(!dini_Exists(str)) return NoSuccess(playerid,"[Notification] You did not Register yet. Please use /register <password> to Register a new account!");
    if(Login[playerid] == 1) return NoSuccess(playerid,"[Notification] You have already been logged in!");
    if(strcmp(params,ReturnPasswort(pname[playerid]),false)) return NoSuccess(playerid,"[Notification] You have     entered an invalid password!");
    
    LoadPlayer(playerid);
    Login[playerid] = 1;
    SendClientMessage(playerid,neongruen,"[Notification] You have successfully been logged in!");
    return 1;
}
But, when i try using /login OR /login <my password>, it says "Unknown Command". Is it because of my command,
Or is it because of something else?

Please help me. Thanks.

Greetings, CrazyManiac.
EDIT:

When i type /Login, it says "Usage: /Login <password>". But when i type /login <my pass>, it says the command does not exists.


Re: Unknown Command problem. - CrazyManiac - 29.11.2012

Anyone?...Bump...