Points.
#1

How can I make a command, for this:

pawn Код:
command(setpoints, playerid, params[])
{
    Player[playerid][Points] ++;
    return 1;
}

But instead of doing it for that person, could I have some help to get it like this:

pawn Код:
command(setpoints, playerid, params[])
{
    Then here the things go, for a cop to set a players points, and an amount of points? :3
}
Thanks.
Reply
#2

Something like this?
pawn Код:
CMD:setpoints(playerid, params[]) {
    new id;
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /setpoints [ID].");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "SERVER: playerid is not connected.");
    Player[id][Points]++;
    return 1;
}
Reply
#3

I want it so then the cop can choose how many points to add :$.
Reply
#4

Maybe this?
pawn Код:
CMD:setpoints(playerid, params[]) {
    new id, value;
    if(sscanf(params, "ui", id, value)) return SendClientMessage(playerid, -1, "USAGE: /setpoints [ID] [VALUE].");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "SERVER: playerid is not connected.");
    // I don't know which way you use to check if player is a cop or not...
    // Edit this, so the if would be "IF PLAYER IS NOT A COP", that's all, I GUESS?
    if(!...) return SendClientMessage(playerid, -1, "You are not a cop!");
    PlayerPoints[id] += value;
    return 1;
}
Reply
#5

pawn Код:
command(setpoints, playerid, params[] )
{
    if ( !IsPlayerCop[ playerid ] ) return 0; // Example
   
    new
        giveplayerid,
        points;

    if ( sscanf( params, "ri", giveplayerid, points ) ) SendClientMessage( playerid, -1, "* Usage: /setpoints [Nick/ID] [Points]" );
    else if ( giveplayerid == INVALID_PLAYER_ID ) SendClientMessage( playerid, -1, "* Player not found!" );
    else
    {
        Player[ playerid ][ Points ] += pointrs;
    }
    return 1;
}
To slow :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)