Whats the problem here?
#1

Код:
if (strcmp(cmd, "/loadfs", true) ==0 )
	{
	  if(IsPlayerConnected(playerid))
	  {
			if (PlayerInfo[playerid][pAdmin] >= 1337)
			{
        tmp = strtok(cmdtext, idx);
			  if(!strlen(tmp))
			  {
				  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /loadfs [fs name]");
				  return 1;
			  }
			  new level;
			  level = strval(tmp);
			  format(string, sizeof(string), "loadfs %s", level);
      	SendRconCommand(string);
			}
		}
		ret
Doesn't work.. Any ideas?
Reply
#2

pawn Код:
#include a_samp

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/loadfs", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE]: /loadfs [fs name]");
return 1;
}
new level;
level = strval(tmp);
format(string, sizeof(string), "/loadfs %s", level);
SendRconCommand(string);
return 1;
}
return 0;
}
Reply
#3

I'm pretty sure you don't have to put the "/" on SendReconCommand, anyway its not working too.
Reply
#4

Maybe just "SendRconCommand("loadfs");"?
Reply
#5

loadfs... what? I need to load %s fs, not just an "fs"...
Someone can help me please?
Reply
#6

Quote:
Originally Posted by еddy
pawn Код:
format(string, sizeof(string), "/loadfs %s", level);
SendRconCommand(string);
}
What you did is wrong, it should be like:
pawn Код:
format(string, sizeof(string), "loadfs %s", level);
SendRconCommand(string);
Reply
#7

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by еddy
pawn Код:
format(string, sizeof(string), "/loadfs %s", level);
SendRconCommand(string);
}
What you did is wrong, it should be like:
pawn Код:
format(string, sizeof(string), "loadfs %s", level);
SendRconCommand(string);
Hmm I didn't do that, he told me to try that, but this is not working, both of the options..
Reply
#8

Quote:
Originally Posted by tomnidi
Hmm I didn't do that, he told me to try that, but this is not working, both of the options..
I wasn't refering to you. Add debug messages to see where the problem appears.
Reply
#9

Thats code is an opposite in itself
pawn Код:
new level;
              level = strval(tmp); //gets the interger of the array tmp
              format(string, sizeof(string), "loadfs %s", level); //to try insert an integer as a string
pawn Код:
if (strcmp(cmd, "/loadfs", true) ==0 )
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                    return SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /loadfs [fs name]");
                format(string, sizeof(string), "loadfs %s", tmp);
                SendRconCommand(string);
            }
        }
        return true;
    }
Reply
#10

Works great, thank you
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)