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
#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;
}
Originally Posted by еddy
pawn Код:
|
format(string, sizeof(string), "loadfs %s", level);
SendRconCommand(string);
Originally Posted by Don Correlli
Quote:
pawn Код:
|
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..
|
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
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;
}