if(strcmp(cmd, "/s", true) == 0 || strcmp(cmd, "/shout", true) == 0)
{
if(!strlen(result))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /s(hout) [text]");
format(string, sizeof(string), "%s shouts: %s!", Name(playerid), result);
ProxDetector(15.0,playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
return 1;
}
stock strrest(const string[],index)
{
new length = strlen(string),offset = index,result[256];
while((index < length) && ((index - offset) < (sizeof(result) - 1)) && (string[index] > '\r')) result[index - offset] = string[index],index++;
result[index - offset] = EOS;
if(result[0] == ' ' && string[0] != ' ') strdel(result,0,1);
return result;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
if(strcmp(cmd, "/shout", true) == 0 || strcmp(cmd, "/s", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You need to login first.");
return 1;
}
new sendername[64];
sendername = name(playerid)
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/s)hout [Local IC]");
return 1;
}
format(string, sizeof(string), "%s Shouts: %s!", sendername, result);
ProxDetector(50.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
printf("%s", string);
}
return 1;
}
pawn Код:
|
CMD:s(playerid,params[])
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /s [shout]");
new sendername[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s Shouts: %s!!", sendername, params);
ProxDetector(40.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
return 1;
}
You just copied and pasted that from another script, i can tell this by the "gPlayerLogged" variable, as his script my not have this variable.
|