Command with a define
#1

Can i edit this?

Код:
#define kills 15
With a command, because i want to be able to edit this definiton to 10, 20 and other numbers when i want to.
Someone please give me an example?
Reply
#2

Just use a var?
Reply
#3

I'm new to variables, how do i do?
Reply
#4

pawn Код:
new kills;

? I don't really understand what you need the command for. Maybe tell me more?
Reply
#5

As for your original question, no you can not change a define - after the script has been compiled. Ever.
Reply
#6

I want to make like a command with /setkills [Kills]
So i could use it like /setkills 20.
Reply
#7

pawn Код:
COMMAND:setkills( playerid, params [ ] )
{
    kills = strval ( params );
    return 1;
}
ZCMD.
Reply
#8

pawn Код:
command(setkills, playerid, params[])
{
    new amount;
    if( sscanf( params, "u", amount ) )
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /setkills [amount]");
    }
    else
    {
        if (IsPlayerAdmin(playerid))
        {
            Kills = amount;
        }
    }
    return 1;
}
idk if it will work. Just an example
Reply
#9

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
pawn Код:
COMMAND:setkills( playerid, params [ ] )
{
    kills = strval ( params );
    return 1;
}
ZCMD.
when i saw it first i was wondering why you didnt use params :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)