error 010: invalid function or declaration
#1

pawn Код:
COMMAND:wave(playerid, arg[])
{
    // Get the nearest player first
    new nearestplayer = GetNearestPlayer(playerid);

    // Make sure the ID is valid
    if(nearestplayer != INVALID_PLAYER_ID)

        // Is the nearest player in wave range?
        if(PlayerInRangeOfPlayer(playerid, nearestplayer, 20.0))
        {
            new line[128];
            new name[MAX_PLAYER_NAME];

            // Show wave message for player being waved at
            GetPlayerName(playerid, name, MAX_PLAYER_NAME);
            format(line, sizeof(line), "%s has waved at you", name);
            SendClientMessage(nearestplayer, 0xFF00FFFF, line);

            // Show wave message for playing waving
            GetPlayerName(nearestplayer, name, MAX_PLAYER_NAME);
            format(line, sizeof(line), "You have waved at %s", name);
            SendClientMessage(playerid, 0xFF00FFFF, line);
        }
        // No one close enough by to wave to
        else SendClientMessage(playerid, 0xFF00FFFF, "There is no one around you");
    }
    // No one was online when you tried to wave
    else SendClientMessage(playerid, 0xFF00FFFF, "There is no one around you");
    return 1;
}
Код:
C:\Users\Grand\Desktop\Ultimate Gaming Ground\gamemodes\STUNTS.pwn(909) : error 010: invalid function or declaration
C:\Users\Grand\Desktop\Ultimate Gaming Ground\gamemodes\STUNTS.pwn(910) : error 010: invalid function or declaration
Also can you change it so it don't sendclientmessage but it sendclientmessagetoall that *playername Waved at PlayerName
Reply
#2

pawn Код:
COMMAND:wave(playerid, arg[])
{
    new nearestplayer = GetNearestPlayer(playerid);

    if(nearestplayer != INVALID_PLAYER_ID)
    { // you forgot her

        if(PlayerInRangeOfPlayer(playerid, nearestplayer, 20.0))
        {
            new line[128];
            new name[MAX_PLAYER_NAME];

 
            GetPlayerName(playerid, name, MAX_PLAYER_NAME);
            format(line, sizeof(line), "%s has waved at you", name);
            SendClientMessage(nearestplayer, 0xFF00FFFF, line);

           
            GetPlayerName(nearestplayer, name, MAX_PLAYER_NAME);
            format(line, sizeof(line), "You have waved at %s", name);
            SendClientMessage(playerid, 0xFF00FFFF, line);
        }

        else SendClientMessage(playerid, 0xFF00FFFF, "There is no one around you");
    }

    else SendClientMessage(playerid, 0xFF00FFFF, "There is no one around you");
    return 1;
}
Quote:
Originally Posted by RandomDude
Посмотреть сообщение
pawn Код:
COMMAND:wave(playerid, arg[])
I don't kwon this way 'arg[]' ....
Reply
#3

Thank you works now!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)