27.06.2011, 13:02
Quote:
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;
}