hello there, i am not sure what, "if (strlen(params))", is supposed to do, but im not that familar with this style command.
params[] = "is the string entered after the command" (
https://sampwiki.blast.hk/wiki/Fast_Commands)
so you only need this if you have a command that either use id like, "/heal 4", or whatever.
pawn Код:
dcmd_kill(playerid, params[])
{
#pragma unused params
if (IsPlayerConnected(playerid))
{
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, 0x008040FF, "You have killed yourself.");
}
return 1;
}
pawn Код:
dcmd_help(playerid, params[])
{
#pragma unused params
if (IsPlayerConnected(playerid))
{
SendClientMessage(playerid, 0x008040FF,"ACCOUNT: /rules,");
SendClientMessage(playerid, 0x008040FF,"JOBS: /merchelp, /lawyerhelp, /armshelp, /drughelp, /wheelhelp");
SendClientMessage(playerid, 0x008040FF,"HOUSES:");
SendClientMessage(playerid, 0x008040FF,"CHAT: (/w)hisper, (/o)oc, (/s)hout, (/c)lose, (/l)ocal, (/b), (/ad)vertise, (/f)amily");
SendClientMessage(playerid, 0x008040FF,"CHAT: /me, /togooc, /tognews, /togfam, /togwhisper");
SendClientMessage(playerid, 0x008040FF,"BANK: /balance, /withdraw, /deposit, /transfer");
}
return 1;
}
pawn Код:
dcmd_rules(playerid, params[])
{
#pragma unused params
if (IsPlayerConnected(playerid))
{
SendClientMessage(playerid, 0x008040FF,"*** OUR RULES ***");
SendClientMessage(playerid, 0x008040FF,"1) Always roleplay. Use /b to talk out of character.");
SendClientMessage(playerid, 0x008040FF,"2) Never DM (Deathmatch - Killing without a roleplay reason).");
SendClientMessage(playerid, 0x008040FF,"3) Show others respect, especially admins.");
SendClientMessage(playerid, 0x008040FF,"4) Absolutely DO NOT Hack/Cheat/Glitch/Exploit. You WILL be banned.");
SendClientMessage(playerid, 0x008040FF,"5) Any other questions/concerns - visit (to come)");
}
return 1;
}