03.01.2013, 18:07
Hello, I'm making a basic admin system. I'm following the tutorial on SA-MP Wiki. It says you will be needing something to do with "ReturnUser". There is a link, but when you click on it it just leads you to SA-MP boards. What do I add to make this work:
Compiler:
pawn Код:
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/makeadmin", true) == 0)
{
new string[128];
new tmp[256];
new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if (IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /makeadmin [playerid] [level]");
SendClientMessage(playerid, COLOUR_ORANGE, "FUNCTION: Player will obtain admin.");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new level = strval(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, player, sizeof(player));
PlayerInfo[giveplayerid][AdminLevel] = level;
printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
format(string, sizeof(string), "You are now an administrator level %d given by %s.", level, player);
SendClientMessage(giveplayerid, 0x00C2ECFF, string);
format(string, sizeof(string), "You have given %s level %d admin.", giveplayer,PlayerInfo[giveplayerid][AdminLevel]);
SendClientMessage(playerid, 0x00C2ECFF, string);
}
else if(giveplayerid == INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%i is not currently on the server.", giveplayerid);
SendClientMessage(playerid, 0xE60000FF, string);
}
}
else
{
SendClientMessage(playerid, 0xE60000FF, "You are not a lead admin, or an owner!");
}
return 1;
}
return 0;
pawn Код:
C:\Users\Zach\Desktop\PAWNO\gamemodes\BasicAdminScript.pwn(142) : error 017: undefined symbol "ReturnUser"
C:\Users\Zach\Desktop\PAWNO\gamemodes\BasicAdminScript.pwn(154) : warning 217: loose indentation
C:\Users\Zach\Desktop\PAWNO\gamemodes\BasicAdminScript.pwn(168) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.