SA-MP Forums Archive
About Sandra's Ranking System - 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: About Sandra's Ranking System (/showthread.php?tid=148968)



About Sandra's Ranking System - DevilRP - 20.05.2010

How can i make a /Prank command,
there is only /myrank command that she made, you cant see other players stats-
http://forum.sa-mp.com/index.php?topic=47989.0
Here is the myrank command-
Код:
	if (strcmp("/Myrank", cmdtext, true) == 0)
	{
  GetPlayerStats(playerid);
  return 1;
}



Re: About Sandra's Ranking System - deather - 20.05.2010

is /prank is to get another player's rank like /prank [playerid]?


Re: About Sandra's Ranking System - DevilRP - 20.05.2010

yea exactly


Re: About Sandra's Ranking System - deather - 20.05.2010

OPCT:
Код:
new cmd[256], tmp[256];
new	idx;
cmd = strtok(cmdtext, idx);
if (strcmp("/prank", cmd, true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /prank [playerid]");
new selectid = strval(tmp);
if(!IsPlayerConnected(selectid )) return SendClientMessage(playerid, 0xAA3333AA, "That player isn't connected.");
if(playerid != selectid)
{
GetPlayerStats(selectid);
}
return 1;
}
DCMD:
Код:
dcmd_prank(playerid, params[])
{
new selectid;
if(sscanf(params, "d", selectid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: '/prank [playerid]'");
GetPlayerStats(selectid);
return 1;
}
ZCMD:
Код:
CMD:prank(playerid, params[])
{
new selectid;
if(sscanf(params, "d", selectid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: '/prank [playerid]'");
GetPlayerStats(selectid);
return 1;
}



Re: About Sandra's Ranking System - DevilRP - 20.05.2010

Thanks man you're a legend!
i got these errors-
Код:
warning 209: function "GetPlayerStats" should return a value

error 047: array sizes do not match, or destination array is too small



Re: About Sandra's Ranking System - deather - 20.05.2010

I have edited the above.

And if it shows error again please tell me in what line it does.


Re: About Sandra's Ranking System - DevilRP - 20.05.2010

still the same man,
Код:
function "GetPlayerStats" should return a value
is the line -
Код:
if(playerid != selectid) return GetPlayerStats(selectid);
and
Код:
error 047: array sizes do not match, or destination array is too small
is the line-
Код:
tmp = strtok(cmdtext,idx);



Re: About Sandra's Ranking System - deather - 20.05.2010

Try Now ^^


Re: About Sandra's Ranking System - DevilRP - 20.05.2010

it show me the compile like this now-
Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:      4636 bytes
Code size:      455328 bytes
Data size:      271008 bytes
Stack/heap size:   16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 747356 bytes
when i type /prank in game it says usage /prank [id]
but when i do lets say /prank 6 it does nothing, and there is such a player


Re: About Sandra's Ranking System - deather - 20.05.2010

Try using dcmd or zcmd.