command involving strcmp - 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: command involving strcmp (
/showthread.php?tid=610734)
command involving strcmp -
justjamie - 27.06.2016
Hello,
i tried to make this command, but it doesn't work.
My knowledge about strcmp is not big.
Can someone tell me what i did wrong here?
thanks
PHP код:
COMMAND:quicklogin(playerid, params[])
{
new tmp[5];
if(!Player[playerid][Authed]) return SendClientError(playerid, "Something went wrong - you're not logged in.");
if(sscanf(params, "s" ,tmp)) return SendClientUsage(playerid, "[ info / enable / disable / addlocation / dellocation ]");
if(!strcmp(tmp, "enable", true, 5))
{
SendClientMessage(playerid,-1,"{FFFFFF}[{6f757d}SR Quicklogin{FFFFFF}] Quicklogin has been enabled!"
SendClientMessage(playerid,-1,"{FFFFFF}[{6f757d}SR Quicklogin{FFFFFF}] You now don't have to use a password anymore!");
Player[playerid][quicklogin] = 1;
}
if(!strcmp(tmp, "disable", true, 5))
{
SendClientMessage(playerid,-1,"{FFFFFF}[{6f757d}SR Quicklogin{FFFFFF}] Quicklogin has been disabled!"
SendClientMessage(playerid,-1,"{FFFFFF}[{6f757d}SR Quicklogin{FFFFFF}] You have to use a password now if you login!");
Player[playerid][quicklogin] = 0;
}
if(!strcmp(tmp, "addlocation", true, 5))
{
SendClientMessage(playerid,-1,"{FFFFFF}[{6f757d}SR Quicklogin{FFFFFF}] Current location has been added for quicklogin!");
}
return 1;
}
OWOW i didnt close them with );
......................................
sorry for my stupid me LOL