16.11.2016, 13:34
Hello,
I need to ask you a question!
I want to add a command like /changeprefix <prefix>, who changed your prefix to what you wrote in <prefix>
I found some code but i cant make to FS..
Here is a code:
If this code have a problems pls fix it, im new in pwn so can i ask you to place the .pwn! Please.
And, can only ppls with rcon have permission to use it!
I need to ask you a question!
I want to add a command like /changeprefix <prefix>, who changed your prefix to what you wrote in <prefix>
I found some code but i cant make to FS..
Here is a code:
PHP код:
if(strcmp(cmd, "/changeprefix", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (logged[playerid] == 1)
{
if(pInfo[playerid][PREFIXlevel] > 0 ) {
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "Използвай: /changeprefix [Prefix]");
return 1;
}
if(strfind( result , "," , true ) == -1)
{
strmid(pInfo[playerid][Prefix], (result), 0, strlen((result)), 129);
format(string, sizeof(string), "{FFFFFF}Ти смени своя префикс на: {9AFF00}%s{FFFFFF}.", (result));
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
else
{
SendClientMessage(playerid, COLOR_RED,"Нямаш необходимия левел, за да сменяш префикса си.");
}
}
}
return 1;
}
And, can only ppls with rcon have permission to use it!