help to Create things
#1

want help to Create simple admin mode
(kick.ban.jail.unjail.frezze.unfrezze.countdown.ge t.goto.afk sys.bank sys.register sys)
and when i kill some 1 to get is money
and when i spawn i spawn many places and not 1
how to send cash
tanks for help
and say where to put any thing
like public ...
and if some 1 can to uplode picture
Reply
#2

Downloading an admin script would give you most of the things.

And the givecash cmd

Код:
public OnPlayerCommandText(playerid,cmdtext[]
{
  dcmd(givecash,8,cmdtext);
  return 0;
}
dcmd_givecash(playerid,params[])
{
  new tmp[256], idx;
  tmp = strtok(params,idx);
  if(!strlen(tmp))
  {
    SendClientMessage(playerid, 0xFF3333AA, "Use: /givecash [playerid] [amount]");
    return true;
  }
  new pid = strval(tmp);
  if(!IsPlayerConnected(pid))
  {
    SendClientMessage(playerid, 0xFF3333AA, "Incorrect playerid.");
    return true;
  }
  tmp = strtok(params,idx);
  if(!strlen(tmp))
  {
    SendClientMessage(playerid, 0xFF3333AA, "Use: /givecash [playerid] [amount]");
    return true;
  }

  if(GetPlayerMoney(playerid) < strval(tmp))
  {
    SendClientMessage(playerid, 0xFF3333AA, "Use: /givecash [playerid] [amount]");
    return true;
  }
  new amount = strval(tmp), string[256], string1[256], pname2[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pname2, sizeof(pname2));
  if(amount <= 0) return SendClientMessage(playerid, COLOUR_RED, "Invalid amount to send.");
  format(string, sizeof(string), "%s sent you $%d", pname2, amount);
  format(string1, sizeof(string1), "You sent %s, $%d", pname2, amount);
  SendClientMessage(pid,0x33AA33AA, string);
  SendClientMessage(playerid,0x33AA33AA, string1);
  GivePlayerMoney(pid, amount);
  GivePlayerMoney(playerid, -amount);
  return true;
}
And the recieve cash when killing

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	new pcash;
	pcash = GetPlayerMoney(playerid);
	GivePlayerMoney(killerid,pcash);
	ResetPlayerMoney(playerid);
	return 1;
}
Reply
#3

about givecash is dont work or tell me where to put it
C:\Documents and Settings\шеп\My Documents\games\gta sa mp server\pawno\bomber.pwn(201) : error 017: undefined symbol "dcmd"
C:\Documents and Settings\шеп\My Documents\games\gta sa mp server\pawno\bomber.pwn(202) : warning 217: loose indentation
C:\Documents and Settings\шеп\My Documents\games\gta sa mp server\pawno\bomber.pwn(450) : warning 203: symbol is never used: "dcmd_givecash"

and about when i died its works
thanks
Reply
#4

Quote:
Originally Posted by rong13
about givecash is dont work or tell me where to put it
C:\Documents and Settings\шеп\My Documents\games\gta sa mp server\pawno\bomber.pwn(201) : error 017: undefined symbol "dcmd"
C:\Documents and Settings\шеп\My Documents\games\gta sa mp server\pawno\bomber.pwn(202) : warning 217: loose indentation
C:\Documents and Settings\шеп\My Documents\games\gta sa mp server\pawno\bomber.pwn(450) : warning 203: symbol is never used: "dcmd_givecash"

and about when i died its works
thanks
OK.
First error means you probably do not even have the #define.
Second warning means the identitation is missed up, it's nothing.
Third warning means you have made the command but you did not put the "dcmd(commandname,lenght,cmdtext);" part in OnPlayerCommandText.
Reply
#5

Add the following under include
Код:
#include <dutils>
#include <dudb>
#include <float>
and this over your first callback
Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#pragma unused ret_memcpy
#pragma tabsize 4
This will allow you to use the dcmd commands which will remove 2 of the 3 errors.

The last 1 which is "Loose indentation" can be fixed by deleting all the spaces before the function then press tab until it fits with the rest of the lines
Reply
#6

its stil dont work same error
and the command dont need to be like these
if (strcmp("/givecash", cmdtext, true, 10) == 0)

and about when i spawn
i spawn in 1 place
and how i do i spawn in many places ?
and about admin some 1 know i to make it ?
i do the /pm ??(player masseage)
Reply
#7

some 1
Reply
#8

Place a copy of your script and i will have a look
Reply
#9

http://pastebin.com/f36282985
that a gamemode that i make
Reply
#10

Код:
if(strcmp("/givecash",true,9) == 0)
{
  new tmp[256], idx;
  tmp = strtok(params,idx);
  if(!strlen(tmp))
  {
    SendClientMessage(playerid, 0xFF3333AA, "Use: /givecash [playerid] [amount]");
    return true;
  }
  new pid = strval(tmp);
  if(!IsPlayerConnected(pid))
  {
    SendClientMessage(playerid, 0xFF3333AA, "Incorrect playerid.");
    return true;
  }
  tmp = strtok(params,idx);
  if(!strlen(tmp))
  {
    SendClientMessage(playerid, 0xFF3333AA, "Use: /givecash [playerid] [amount]");
    return true;
  }

  if(GetPlayerMoney(playerid) < strval(tmp))
  {
    SendClientMessage(playerid, 0xFF3333AA, "Use: /givecash [playerid] [amount]");
    return true;
  }
  new amount = strval(tmp), string[256], string1[256], pname2[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pname2, sizeof(pname2));
  if(amount <= 0) return SendClientMessage(playerid, 0xFF3333AA, "Invalid amount to send.");
  format(string, sizeof(string), "%s sent you $%d", pname2, amount);
  format(string1, sizeof(string1), "You sent %s, $%d", pname2, amount);
  SendClientMessage(pid,0x33AA33AA, string);
  SendClientMessage(playerid,0x33AA33AA, string1);
  GivePlayerMoney(pid, amount);
  GivePlayerMoney(playerid, -amount);
  return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)