Command help
#1

hello,

ive need a code thats makes a code only usable for my SA-MP In Game Name
pls a quick tut
Reply
#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
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)