27.06.2011, 12:41
hello,
ive need a code thats makes a code only usable for my SA-MP In Game Name
pls a quick tut
ive need a code thats makes a code only usable for my SA-MP In Game Name
pls a quick tut
hello,
ive need a code thats makes a code only usable for my SA-MP In Game Name pls a quick tut |
command(test, playerid, params[])
{
if(!strmatch(GetName(playerid), "Yourusername")) return 0; // only usable by Yourusername
/* Do smthn here */
return 1;
}
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;
}