Help me please with this I have a question about a array..?
#1

Hey,

I have a question:

I have this array:

new joints[MAX_PLAYERS];

now I want to create a command that sets the joints of the player you typed in as id to be higher with one.

So let's see:

/givejoint [id]

will give the ID one joint.

Does someone knows how to get this working?

Thanks alot
Reply
#2

I think you need to explain more. Right now, I can't figure out anything.
Reply
#3

pawn Код:
zcmd(givejoint, playerid, params[])
{
    new
        szPlayer,
        szString[ 128 ];

    if(!IsPlayerAdmin(playerid))
        return SendClientMessage( playerid, COLOR_WHITE, " Only admins can spread out joints!");
       
    if( sscanf ( params, "u", szPlayer ))
        return SendClientMessage( playerid, COLOR_WHITE, " Use: \"/givejoint [ playerid / part of name ]\" ");
       
    joints[ szPlayer ]++;
 
    format ( szString , sizeof( szString ), " You have given %s a joint!", ReturnPlayerName( szPlayer ));
    SendClientMessage( playerid, COLOR_WHITE, string );
    format ( szString , sizeof( szString ), " You received a joint by %s!", ReturnPlayerName( playerid ));
    SendClientMessage( playerid, COLOR_WHITE, string );
    return 1;
}
You (obviously) need the zcmd include. (which also includes sscanf)
Reply
#4

Wow...? can't figure it out, can someone explain or help me more?? thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)