SA-MP Forums Archive
Command help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Command help (/showthread.php?tid=264717)



Command help - speediekiller3 - 27.06.2011

hello,

ive need a code thats makes a code only usable for my SA-MP In Game Name
pls a quick tut


Re: Command help - Cameltoe - 27.06.2011

Quote:
Originally Posted by speediekiller3
Посмотреть сообщение
hello,

ive need a code thats makes a code only usable for my SA-MP In Game Name
pls a quick tut
pawn Код:
command(test, playerid, params[])
{
     if(!strmatch(GetName(playerid), "Yourusername")) return 0; // only usable by Yourusername
     /* Do smthn here */
     return 1;
}
pawn Код:
stock strmatch(const String1[], const String2[])
{
    if ((strcmp(String1, String2, true, strlen(String2)) == 0) && (strlen(String2) == strlen(String1)))
    {
        return true;
    }
    else
    {
        return false;
    }
}

stock GetName(playerid)
{
    new pName[25];
    GetPlayerName(playerid, pName, sizeof(pName));
    return pName;
}



Re: Command help - speediekiller3 - 27.06.2011

thnx but how can i put this in my GM that's uses the orig command text