About Sandra's Ranking System
#1

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;
}
Reply
#2

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

yea exactly
Reply
#4

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;
}
Reply
#5

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
Reply
#6

I have edited the above.

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

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);
Reply
#8

Try Now ^^
Reply
#9

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
Reply
#10

Try using dcmd or zcmd.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)