String error
#1

whats wrong with this ?

pawn Код:
CMD:slap(playerid, params[])
{

    SendAdminText(playerid, "/slap", params);
    {
      new ID;
      if(APlayerData[playerid][PlayerLevel] < 2) return SendClientMessage(playerid, -1, "you are not admin.");
      if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "Use: /slap [ID]");
      new Float:Pos[3];
      GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
      SetPlayerPos(ID, Pos[0], Pos[1], Pos[2]+10);
      SendClientMessage(playerid, 0xff0000FF, "You have been slapped By Admin %s", Name);
      format(string, 128, "{808080}%s %s has Slapped {FFFF00}%s", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, Name);
        SendClientMessageToAll(0xFFFFFFFF, string);
    }
    return 1;
}
errors
pawn Код:
C:\Documents and Settings\BaLLy\Desktop\The Original\pawno\include\PPC_PlayerCommands.inc(12) : error 017: undefined symbol "Name"
C:\Documents and Settings\BaLLy\Desktop\The Original\pawno\include\PPC_PlayerCommands.inc(13) : error 017: undefined symbol "string"
C:\Documents and Settings\BaLLy\Desktop\The Original\pawno\include\PPC_PlayerCommands.inc(14) : warning 217: loose indentation
C:\Documents and Settings\BaLLy\Desktop\The Original\pawno\include\PPC_PlayerCommands.inc(14) : error 017: undefined symbol "string"
Reply
#2

pawn Код:
CMD:slap(playerid, params[])
{

    SendAdminText(playerid, "/slap", params);
    {
      new ID,string[128],Name[24];
      if(APlayerData[playerid][PlayerLevel] < 2) return SendClientMessage(playerid, -1, "you are not admin.");
      if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "Use: /slap [ID]");
      new Float:Pos[3];
      GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
      SetPlayerPos(ID, Pos[0], Pos[1], Pos[2]+10);
      SendClientMessage(playerid, 0xff0000FF, "You have been slapped By Admin %s", Name);
      format(string, 128, "{808080}%s %s has Slapped {FFFF00}%s", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, Name);
        SendClientMessageToAll(0xFFFFFFFF, string);
    }
    return 1;
}
Reply
#3

pawn Код:
CMD:slap(playerid, params[])
{
    SendAdminText(playerid, "/slap", params);
    new ID, string[128], Name[MAX_PLAYER_NAME];
    if(APlayerData[playerid][PlayerLevel] < 2) return SendClientMessage(playerid, -1, "you are not admin.");
    if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "Use: /slap [ID]");
    new Float:Pos[3];
    GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
    SetPlayerPos(ID, Pos[0], Pos[1], Pos[2]+10);
    SendClientMessage(playerid, 0xff0000FF, "You have been slapped By Admin %s", Name);
    format(string, 128, "{808080}%s %s has Slapped {FFFF00}%s", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, Name);
    return SendClientMessageToAll(0xFFFFFFFF, string);
}
By the way, why you opened a bracket after SendAdminText. It doesn't need.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)