Command help
#2

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;
}
Reply


Messages In This Thread
Command help - by speediekiller3 - 27.06.2011, 12:41
Re: Command help - by Cameltoe - 27.06.2011, 13:02
Re: Command help - by speediekiller3 - 27.06.2011, 13:06

Forum Jump:


Users browsing this thread: 1 Guest(s)