/world does not work correctly | and trouble with making /setadminlevel
#1

Ok so I tried to make a /world (setworld) and when I do /world [worldid] it sets it to something random eg: /world 0 world gets set to world 48
Code:
pawn Код:
if(!strcmp(cmdtext, "/world", true, 3))
{
    if(!cmdtext[6])return SendClientMessage(playerid, COLOR_RED, "USAGE: /world [world]");
    new string[128];
    new name[MAX_PLAYERS];
    GetPlayerName(playerid,name,sizeof(name));
    SetPlayerVirtualWorld(playerid, cmdtext[7]);
    format(string,sizeof(string),"You have set your world to: %s.",cmdtext[7]);
    SendClientMessage(playerid, COLOR_AFK, string);
    return 1;
}
My other question I found out how to make a /slap [playerid] but I can not figure out how to make a /setadminlevel [playerid] [level]
The slap cmd
pawn Код:
if(strcmp(cmd, "/sal", true) == 0)
{
    new string[256];
    new adminname[256];
    new playername[256];
    new id;
    new tmp[256];
    new Float:health, Float:x, Float:y, Float:z;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
        SendClientMessage(playerid, COLOR_WHITE, "Usage: /slap <playerid>");
        return 1;
     }
     if(Admin[playerid] >= 10)
     {
        id = strval(tmp);
        if(IsPlayerConnected(id))
    {
            GetPlayerPos(id, x, y, z);
            PlayerPlaySound(id, 1190, x, y, z);
            SetPlayerPos(id, x, y, z+10);
                GetPlayerHealth(id, health);
                SetPlayerHealth(id, health-5);
            GetPlayerName(id, playername, 256);
            GetPlayerName(playerid, adminname, 256);
                format(string, sizeof(string), "%s has slapped %s.", adminname, playername);
                SendClientMessageToAll(COLOR_ADMIN, string);
        }
        else
    {
            format(string, sizeof(string), "%d is not an active player.", id);
            SendClientMessage(playerid, COLOR_RED, string);
        }
      }
      else
      {
            SendClientMessage(playerid,COLOR_RED,"ERROR: You are not the correct level admin.");
       }
       return 1;
}
Any help/thoughts?
Reply


Messages In This Thread
/world does not work correctly | and trouble with making /setadminlevel - by Яσскѕтая - 21.07.2010, 16:08
Re: /world does not work correctly | and trouble with making /setadminlevel - by DJDhan - 21.07.2010, 16:35
Re: /world does not work correctly | and trouble with making /setadminlevel - by John_F - 21.07.2010, 16:54
Re: /world does not work correctly | and trouble with making /setadminlevel - by Яσскѕтая - 21.07.2010, 17:03

Forum Jump:


Users browsing this thread: 1 Guest(s)