/slap command
#1

Код:
C:\Users\kevin.H1964542\Desktop\SAMP Kevin\pawno\include\PPC_PlayerCommands.inc(4) : error 001: expected token: "-identifier-", but found "["
C:\Users\kevin.H1964542\Desktop\SAMP Kevin\pawno\include\PPC_PlayerCommands.inc(8) : error 027: invalid character constant
C:\Users\kevin.H1964542\Desktop\SAMP Kevin\pawno\include\PPC_PlayerCommands.inc(8) : warning 217: loose indentation
C:\Users\kevin.H1964542\Desktop\SAMP Kevin\pawno\include\PPC_PlayerCommands.inc(9) : error 017: undefined symbol "Name"
C:\Users\kevin.H1964542\Desktop\SAMP Kevin\pawno\include\PPC_PlayerCommands.inc(9) : error 017: undefined symbol "Name"
C:\Users\kevin.H1964542\Desktop\SAMP Kevin\pawno\include\PPC_PlayerCommands.inc(9) : error 029: invalid expression, assumed zero
C:\Users\kevin.H1964542\Desktop\SAMP Kevin\pawno\include\PPC_PlayerCommands.inc(9) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
These six errors I get when my command try to compile.

Current pawn code:
pawn Код:
COMMAND:slap(playerid,params[])
{  
    new OtherPlayer, Msg,[150], Name[24], Message[150], OtherPlayerName[24];
    SendAdminText(playerid,"/slap", params);
   
    if (APlayerData[playerid][PlayerLevel] >= 2)
'   {
        GetPlayerName(playerid, Name, sizeof(Name));
        GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
        format(Msg, sizeof(MSg), "%s Slaps %s because %s", Name, OtherPlayerName, Message);
        SendClientMessageToAll(0xFFFFFFFF, Msg);
        SetPlayerHealth(OtherPlayer, 75);
    }
    else
        return 0;
}
I Try to make it like:

* SomebodyAndMe slaps 1 annoying around a bit with a large trout.
Sendclientmessagetoall: Admin: "adminname" slaps "otherplayername" because "reason".
Then the other player will lose 25% health.


Anyone knows a fix or the whole command?
Reply
#2

pawn Код:
COMMAND:slap(playerid,params[])
{  
    new OtherPlayer, Msg,[150], Name[24], Message[150], OtherPlayerName[24];
    SendAdminText(playerid,"/slap", params);
   
    if (APlayerData[playerid][PlayerLevel] >= 2)
    {
        GetPlayerName(playerid, Name, sizeof(Name));
        GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
        format(Msg, sizeof(MSg), "%s Slaps %s because %s", Name, OtherPlayerName, Message);
        SendClientMessageToAll(0xFFFFFFFF, Msg);
        SetPlayerHealth(OtherPlayer, 75);
    }
    else
    {
        return 0;
    }
    return 1;
}
Reply
#3

Did you even included <a_samp> and <zcmd> ?
Reply
#4

Lol guys , look it better
pawn Код:
Msg,[150]
He wrote a "," before the [150]
pawn Код:
COMMAND:slap(playerid,params[])
{
    new OtherPlayer, Msg[150], Name[24], Message[150], OtherPlayerName[24];
    SendAdminText(playerid,"/slap", params);
    if (APlayerData[playerid][PlayerLevel] >= 2) {
        GetPlayerName(playerid, Name, sizeof(Name));
        GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
        format(Msg, sizeof(MSg), "%s Slaps %s because %s", Name, OtherPlayerName, Message);
        SendClientMessageToAll(0xFFFFFFFF, Msg);
        SetPlayerHealth(OtherPlayer, 75);
    }
    else {
        return 0;
    }
    return 1;
}
Reply
#5

Код:
Msg,[150]
I'm pretty sure that fails alot...
also this
Код:
    if (APlayerData[playerid][PlayerLevel] >= 2)
'   {
fails too... remove the '
Reply
#6

Quote:
Originally Posted by FireCat
Посмотреть сообщение
pawn Код:
COMMAND:slap(playerid,params[])
{  
    new OtherPlayer, Msg,[150], Name[24], Message[150], OtherPlayerName[24];
    SendAdminText(playerid,"/slap", params);
   
    if (APlayerData[playerid][PlayerLevel] >= 2)
    {
        GetPlayerName(playerid, Name, sizeof(Name));
        GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
        format(Msg, sizeof(MSg), "%s Slaps %s because %s", Name, OtherPlayerName, Message);
        SendClientMessageToAll(0xFFFFFFFF, Msg);
        SetPlayerHealth(OtherPlayer, 75);
    }
    else
    {
        return 0;
    }
    return 1;
}
Not working, getting this:

Код:
C:\Users\kevin.H1964542\Desktop\SAMP Kevin\pawno\include\PPC_PlayerCommands.inc(4) : error 001: expected token: "-identifier-", but found "["
C:\Users\kevin.H1964542\Desktop\SAMP Kevin\pawno\include\PPC_PlayerCommands.inc(9) : error 017: undefined symbol "Name"
C:\Users\kevin.H1964542\Desktop\SAMP Kevin\pawno\include\PPC_PlayerCommands.inc(9) : error 017: undefined symbol "Name"
C:\Users\kevin.H1964542\Desktop\SAMP Kevin\pawno\include\PPC_PlayerCommands.inc(9) : error 029: invalid expression, assumed zero
C:\Users\kevin.H1964542\Desktop\SAMP Kevin\pawno\include\PPC_PlayerCommands.inc(9) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
and
Quote:

Did you even included <a_samp> and <zcmd> ?

I did
Reply
#7

User fixed problem, removed.
Reply
#8

Try this:
Код:
COMMAND:slap(playerid,params[])
{  
    new OtherPlayer, Msg[150], Name[24], Message[150], OtherPlayerName[24];
    SendAdminText(playerid,"/slap", params);
   
    if (APlayerData[playerid][PlayerLevel] >= 2)
    {
        GetPlayerName(playerid, Name, sizeof(Name));
        GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
        format(Msg, sizeof(MSg), "%s Slaps %s because %s", Name, OtherPlayerName, Message);
        SendClientMessageToAll(0xFFFFFFFF, Msg);
        SetPlayerHealth(OtherPlayer, 75);
    }
    else
    {
        return 0;
    }
    return 1;
}
Reply
#9

Fixed the problem sorry im so tired and need to fix server. Thanks all for the support!
Reply
#10

UPDATE, problem not fixed, now only the user with ID 0 gets slapped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)