19.02.2012, 21:40
Hello Guys , Can you show me the TUT. of /me and /do command or something?
CMD:me(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, -1, "/me [text]");
new
string[128],
pName[20 char]
;
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "* %s %s *", pName, params);
return SendClientMessageToAll(-1, string);
}
L:\Gta San Andreas\Gta San Andreas\Gta San Andreas\Scripting\gamemodes\Dude.pwn(193) : error 017: undefined symbol "me" L:\Gta San Andreas\Gta San Andreas\Gta San Andreas\Scripting\gamemodes\Dude.pwn(195) : error 017: undefined symbol "params" L:\Gta San Andreas\Gta San Andreas\Gta San Andreas\Scripting\gamemodes\Dude.pwn(195) : error 029: invalid expression, assumed zero L:\Gta San Andreas\Gta San Andreas\Gta San Andreas\Scripting\gamemodes\Dude.pwn(195) : error 017: undefined symbol "params" L:\Gta San Andreas\Gta San Andreas\Gta San Andreas\Scripting\gamemodes\Dude.pwn(195) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors. |
command(me, playerid, params[]) {
new
string[128];
if(isnull(params)) {
return SendClientMessage(playerid, WHITE, "SYNTAX: /me [action]");
}
else {
if(Player[playerid][PrisonID] == 1) {
SendClientMessage(playerid, WHITE, "You're unable to do this right now!");
}
else {
format(string, sizeof(string), "* %s %s", GetNameU(playerid), params);
NearByMessage(playerid, NICESKY, string);
Player[playerid][MeActions]++;
}
}
return 1;
}
#define RP_CHATS 0xBE9BC1FF
stock ProxDetector(Float:radi, playerid, string[],color)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
for(new player;player<MAX_PLAYERS;player++)
{
if(!IsPlayerConnected(playerid))continue;
if(IsPlayerInRangeOfPoint(playerid,radi,x,y,z)) SendClientMessage(player,color,string);
}
}
CMD:me(playerid, params[])
{
new name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, sizeof(name));
strreplace(name,'_',' ');
if(sscanf(params,"s[128]",str)) return SendClientMessage(playerid,COLOR_LIGHTGRAY,"USAGE: /me [action]");
format(str,sizeof(str),"*%s %s",name, params);
ProxDetector(30.0, playerid, str, COLOR_MEDIUMPURPLE);
return 1;
}
CMD:do(playerid, params[])
{
new name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, sizeof(name));
strreplace(name,'_',' ');
if(sscanf(params,"s[128]",str))
{
SendClientMessage(playerid,COLOR_LIGHTGRAY,"USAGE: /do [action]");
return 1;
}
else
{
format(str,sizeof(str),"*%s (( %s ))",params, name);
ProxDetector(30.0, playerid, str, COLOR_MEDIUMPURPLE);
}
return 1;
}