20.03.2011, 15:14
(
Последний раз редактировалось Kwarde; 05.05.2011 в 12:51.
)
Hi.
I've noticed that people ask alot the same questions. Especially the /me command..
So I'm now gonna post them. No need to ask it anymore after this post.
For commands, I'll use ZCMD(+SSCANF)
Basic colors
Put these above in your script, below the includes
* Kwarde command - Show an action of your character (eg. '* Kwarde is dying' (/me is dying)
NOTE: Global chat! Not usefull for RL servers, unless if you edit it
/do command - Suggest an action (idk how to explain). eg. "/do checking license." : "Checking license. Do you have one? (( Kevin_Warde ))
NOTE: Global chat! Not usefull for RL servers, unless if you edit it
/mute command (+ script) - Prevent a player to talk in the normal chat
NOTE: Will not work for eg. /pm commands
/explode - Will explode a player.
Gang System
This one has been made by Cameltoe.
Here's the script: https://sampforum.blast.hk/showthread.php?tid=243214
It's using mysql+sscanf+zcmd.
Vehicle Spawner
Made by myself, it's a bigger script, so you can view it here:
https://sampforum.blast.hk/showthread.php?pid=879008#pid879008
Vehicles from grand larcency to AddStaticVehicleEx
See this topic: https://sampforum.blast.hk/showthread.php?tid=253202
NOTE: I'll add more later.it.
- Kevin
I've noticed that people ask alot the same questions. Especially the /me command..
So I'm now gonna post them. No need to ask it anymore after this post.
For commands, I'll use ZCMD(+SSCANF)
Basic colors
Put these above in your script, below the includes
pawn Код:
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_RED 0xFF0000AA
#define COLOR_GREEN 0x00FF00AA
#define COLOR_BLUE 0x0000FFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_ORANGE 0xFFAA00AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GRAY COLOR_GREY //for those who prefer using COLOR_GRAY instead of COLOR_GREY)
NOTE: Global chat! Not usefull for RL servers, unless if you edit it
pawn Код:
CMD:me(playerid, params[])
{
new pName[25], str[128];
if(!strlen(params[0])) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]");
GetPlayerName(playerid, pName, 25);
format(str, 128, "%s %s", pName, str);
SendClientMessageToAll(COLOR_YELLOW, str);
return 1;
}
NOTE: Global chat! Not usefull for RL servers, unless if you edit it
pawn Код:
CMD:do(playerid, params[])
{
new pName[25], str[128];
if(!strlen(params[0])) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /do [action]");
GetPlayerName(playerid, pName, 25);
format(str, 128, "%s (( %s ))", str, pName);
SendClientMessageToAll(COLOR_ORANGE, str);
return 1;
}
NOTE: Will not work for eg. /pm commands
pawn Код:
// Global variable. Don't put it in a command, callback or function. Place it below the defines and includes
new bool:kMuted[MAX_PLAYERS];
// Put this on OnPlayerConnect
kMuted[strval(params[0])] = false;
// Put this in OnPlayerText
if(kMuted[playerid]){
SendClientMessage(playerid, COLOR_RED, "ERROR: You are muted!");
return 0;
}
// The command
CMD:mute(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a RCON admin!");
if(!strlen(params[0])) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /mute [playerid]");
if(!IsPlayerConnected(strval(params[0]))) return SendClientMessage(playerid, COLOR_RED, "ERROR: Given player ID not connected");
if(kMuted[strval(params[0])]){
kMuted[strval(params[0])] = false;
SendClientMessage(playerid, COLOR_GREEN, "* The player has been unmuted.");
SendClientMessage(strval(params[0]), COLOR_GREEN, "* You have been unmuted by an administrator.");
}
else{
kMuted[strval(params[0])] = true;
SendClientMessage(playerid, COLOR_GREEN, "* The player has been muted.");
SendClientMessage(strval(params[0]), COLOR_RED, "* You have been muted by an administrator!");
}
return 1;
}
pawn Код:
CMD:explode(playerid, params[])
{
new Float:pPos[3];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a RCON administrator.");
if(!IsPlayerConnected(strval(params[0]))) return SendClientMessage(playerid, COLOR_RED, "ERROR: Given player ID is not online");
GetPlayerPos(strval(params[0]), pPos[0], pPos[1], pPos[2]);
CreateExplosion(pPos[0], pPos[1], pPos[2], 11, 1.5);
SendClientMessage(playerid, COLOR_GREEN, "* Player has been exploded");
return 1;
}
This one has been made by Cameltoe.
Here's the script: https://sampforum.blast.hk/showthread.php?tid=243214
It's using mysql+sscanf+zcmd.
Vehicle Spawner
Made by myself, it's a bigger script, so you can view it here:
https://sampforum.blast.hk/showthread.php?pid=879008#pid879008
Vehicles from grand larcency to AddStaticVehicleEx
See this topic: https://sampforum.blast.hk/showthread.php?tid=253202
NOTE: I'll add more later.it.
- Kevin