Help me please with this I have a question about a array..? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me please with this I have a question about a array..? (
/showthread.php?tid=105292)
Help me please with this I have a question about a array..? -
dirkblok - 28.10.2009
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
Re: Help me please with this I have a question about a array..? -
Tigerbeast11 - 28.10.2009
I think you need to explain more. Right now, I can't figure out anything.
Re: Help me please with this I have a question about a array..? -
woot - 28.10.2009
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)
Re: Help me please with this I have a question about a array..? -
dirkblok - 28.10.2009
Wow...? can't figure it out, can someone explain or help me more?? thanks