What is the easiest way?
#1

What is the easiest way to have the other player take the effect.

For example I want to kick the other player not me, or SendClientMessage to
the specific player id.

What are you talking about?

How to do a /command [player id]
Reply
#2

zcmd + sscanf
Reply
#3

I personally prefer using strtok to get the command parameters.
Reply
#4

Quote:
Originally Posted by Conroy
I personally prefer using strtok to get the command parameters.
As Conroy said, using strtok is the easiest for me too.

Example:

Код:
dcmd_sethealth(playerid,params)
{
 If(IsPlayerAdmin(playerid)
 {
  new Index;
	  new tmp[256]; tmp = strtok(params,Index);
	  new tmp2[256]; tmp2 = strtok(params,Index);
	  if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return
	  SendClientMessage(playerid, LIGHTBLUE2, "Usage: /sethealth [PlayerID] [Value]") &&
		

		if(strval(tmp2) < 0 || strval(tmp2) > 100 && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return
		SendClientMessage(playerid, red, "ERROR: Invaild Health amount!");
		new player1 = strval(tmp);
		new health = strval(tmp2);
		new string[128];
  //and blablbla
So basically tmp take in the playerid you want to set the health of and tmp2 take in the health amount you want to set.
Reply
#5

Its Zcmd + SScanf , but i prefer using dcmd+sscanf cause I've been using it for alot of time
Reply
#6

Its Easier strtok Its Basic For Pawno But Its Not Complicated As Much as zcmd or sscanf

Hope This Helped You
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)