PDA

View Full Version : None of my cmds are working...


SteSte
03/07/2017, 04:08 AM
Can somebody help me, if you have teamviewer add me on skype Heroleo911003
None of my commands are working in my script, I dont know why, I dont see any problem.

Kane
03/07/2017, 04:11 AM
What do you mean by not working? Post your server_log.txt.

aoky
03/07/2017, 04:14 AM
Can you post one of your cmds? If you're using zcmd make sure your commands are like this:

CMD:hello

and not

cmd:hello

SteSte
03/07/2017, 04:17 AM
What do you mean by not working? Post your server_log.txt.

My log wont help, this is my script PasteBin (https://pastebin.com/5aaCwUzQ)

SteSte
03/07/2017, 04:20 AM
Can you post one of your cmds? If you're using zcmd make sure your commands are like this:

CMD:hello

and not

cmd:hello

CMD:rollini(playerid, params[])
{
new string[128], num;
num = randomEx(0, 20);
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(IsPlayerConnected(i))
{
CheckNearbyPlayers(playerid, i, 10);
format(string, sizeof string, "ROLL: %s has initiated a roll of %d", NameEx(playerid), num);
SCM(i, -1, string);
}
}
return 1;
}

Above is a cmd that works below is one that doesn't

CMD:tisland(playerid,params[])
{
if(PlayerInfo[playerid][AdminLevel] < 1) return SCM(playerid, -1, "ERROR: Invalid Command!");
SetPlayerPos(playerid, -3230.0759,2576.5918,12.5826);
SCM(playerid, Col_Grey, "SERVER: You have teleported to Tutorial Island, your virtual world has been changed. Remember to /goback.");
SetPlayerVirtualWorld(playerid, 1);
return 1;
}

aoky
03/07/2017, 04:30 AM
CMD:tisland(playerid,params[])
{
if(PlayerInfo[playerid][AdminLevel] < 1) return SCM(playerid, -1, "ERROR: Invalid Command!");
{
SetPlayerPos(playerid, -3230.0759,2576.5918,12.5826);
SCM(playerid, Col_Grey, "SERVER: You have teleported to Tutorial Island, your virtual world has been changed. Remember to /goback.");
SetPlayerVirtualWorld(playerid, 1);
}
return 1;
}

nG Inverse
03/07/2017, 04:33 AM
Ignore the reply above.

What do you mean by it doesn't work? When you call the command what happens? Position change, receive the message, virtual world set, etc?

SteSte
03/07/2017, 04:33 AM
CMD:tisland(playerid,params[])
{
if(PlayerInfo[playerid][AdminLevel] < 1) return SCM(playerid, -1, "ERROR: Invalid Command!");
{
SetPlayerPos(playerid, -3230.0759,2576.5918,12.5826);
SCM(playerid, Col_Grey, "SERVER: You have teleported to Tutorial Island, your virtual world has been changed. Remember to /goback.");
SetPlayerVirtualWorld(playerid, 1);
}
return 1;
}


Thats wrong! Read it again if(PlayerInfo[playerid][AdminLevel] < 1) return SCM(playerid, -1, "ERROR: Invalid Command!");

aoky
03/07/2017, 04:34 AM
This should be

if(PlayerInfo[playerid][AdminLevel] > 1) return SCM(playerid, -1, "ERROR: Invalid Command!");

SteSte
03/07/2017, 04:35 AM
Ignore the reply above.

What do you mean by it doesn't work? When you call the command what happens? Position change, receive the message, virtual world set, etc?

Most of my cmds are not working
for /tisland its suppose to teleport to me to an a scripted map but instead it says ERROR: Invalid Command
if(PlayerInfo[playerid][AdminLevel] < 1) return SCM(playerid, -1, "ERROR: Invalid Command!");
And yes before you ask, I did make myself admin

aoky
03/07/2017, 04:37 AM
CMD:tisland(playerid,params[])
{
if(PlayerInfo[playerid][AdminLevel] > 1)
{
SetPlayerPos(playerid, -3230.0759,2576.5918,12.5826);
SCM(playerid, Col_Grey, "SERVER: You have teleported to Tutorial Island, your virtual world has been changed.
Remember to /goback.");
SetPlayerVirtualWorld(playerid, 1);
}
return 1;
}


Just do that. No need for an unknown command.

SteSte
03/07/2017, 04:38 AM
This should be

if(PlayerInfo[playerid][AdminLevel] > 1) return SCM(playerid, -1, "ERROR: Invalid Command!");

No, the way I have it is correct.

Yours says if the player's admin level is higher then 1 then give them error msg.

SteSte
03/07/2017, 04:40 AM
CMD:tisland(playerid,params[])
{
if(PlayerInfo[playerid][AdminLevel] > 1)
{
SetPlayerPos(playerid, -3230.0759,2576.5918,12.5826);
SCM(playerid, Col_Grey, "SERVER: You have teleported to Tutorial Island, your virtual world has been changed.
Remember to /goback.");
SetPlayerVirtualWorld(playerid, 1);
}
return 1;
}


Just do that. No need for an unknown command.

Sure I'll erase my ERROR MESSAGE

nG Inverse
03/07/2017, 04:41 AM
@aoky: Please stop.

Whatever you did to make yourself admin, it didn't update the necessary variable 'PlayerInfo[playerid][AdminLevel]' or your level isn't set above 1.

We would need more information to pinpoint the issue. How you set yourself admin: in-game, editing save file/db; What save system you use; etc.

SteSte
03/07/2017, 04:54 AM
@aoky: Please stop.

Whatever you did to make yourself admin, it didn't update the necessary variable 'PlayerInfo[playerid][AdminLevel]' or your level isn't set above 1.

We would need more information to pinpoint the issue. How you set yourself admin: in-game, editing save file/db; What save system you use; etc.

Heres the more info My PasteBin (https://pastebin.com/h9dm98sy)
After exiting I check the scriptfiles andI see my admin level "8"

adri[4]Life
03/07/2017, 05:06 AM
Most of my cmds are not working
for /tisland its suppose to teleport to me to an a scripted map but instead it says ERROR: Invalid Command
if(PlayerInfo[playerid][AdminLevel] < 1) return SCM(playerid, -1, "ERROR: Invalid Command!");
And yes before you ask, I did make myself admin

Probably it's the cmd which set you as an admin is bugged, so try to check your database folder and set it manually then restart the server and test the bugged cmds

nG Inverse
03/07/2017, 05:12 AM
Your "setlevel" command never updates the PlayerInfo[playerid][AdminLevel] variable.

By brief scan of the code though, if you rejoin after setting it in-game, it should work. That assumes you're using y_ini correctly. I'm not familiar with it so cannot help there.

SteSte
03/07/2017, 05:27 AM
Hmm, I'll try, but I dont think I'll work.

Beryllium
03/07/2017, 07:00 AM
CMD:tisland(playerid,params[])
{
if(PlayerInfo[playerid][AdminLevel] < 1)
{
SetPlayerPos(playerid, -3230.0759,2576.5918,12.5826);
SendClientMessage(playerid, Col_Grey, "SERVER: You have teleported to Tutorial Island, your virtual world has been changed. Remember to /goback.");
SetPlayerVirtualWorld(playerid, 1);
}
else
{
SendClientMessage(playerid, -1, "ERROR: Invalid Command!");
}
return 1;
}


This supposed to work, I've tested it and worked.

EDIT: I've teamviewed his pc and solved his problem.
Case Closed.