hellp everyone this is my first Samp Script Help Request
#1

So I was making a SAMP Admin Script I need to know how to make a ban command dcmd_ban i have everything i need but this error shows up this is the code

dcmd_akill(playerid, params[])
{
new giveplayerid = ReturnUser(tmp, playerid);
if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
{
new string[100];
format(string, sizeof(string), "You must be administrator level %d to use that command!", gCommands[AKILL]);
return SendClientMessage(playerid, COLOUR_ORANGE, string);
}
else if(!strlen(params))
return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /akill [id | name]");
else
{
if(IsPlayerConnected(giveplayerid))
{
SetPlayerHealth(giveplayerid, 0.0);
new string[150];
format(string, sizeof(string), "You have been admin-killed by administrator \'%s\'.", gPlayerInfo[playerid][PLAYER_NAME]);
SendClientMessage(giveplayerid, COLOUR_ORANGE, string);
format(string, sizeof(string), "You have successfully admin-killed player \'%s\'.", gPlayerInfo[giveplayerid][PLAYER_NAME]);
return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
}
else
return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You can not admin-kill yourself or a disconnected player.");
}
}

the error is

C:\Users\Welcome\Desktop\samp03asvr_R3_win32\pawno \AdminScript.pwn(290) : error 017: undefined symbol "ReturnUser"

i just wanna know how to make a GivePlayerID like the player you are gonna kill plz thanks
Reply
#2

You need the returnuser function.

[quote]
pawn Код:
ReturnUser(string[])
{
  new IsNumerical=1;
  new tmpstring[MAX_PLAYER_NAME];
  for(new cell; cell < strlen(string); cell++) if((string[cell]<='0') || (string[cell]>='9'))IsNumerical=0;
  if(IsNumerical)return strval(string);
  else
  {
    for(new players; players < MAX_PLAYERS; players++)
    {
      GetPlayerName(players,tmpstring,sizeof(tmpstring));
      if(strfind(tmpstring,string,true)>-1)return players;
    }
  }
  return INVALID_PLAYER_ID;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)