Making a /setsdoor
#8

pawn Код:
//on top
new CanUseDoor[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext,"/osdoor", true) == 0 && CanUseDoor[playerid] == 1)
    {
        MoveObject(sdoor, 2974.106445,2124.700683,8.532794, 1.500000);
        MoveObject(radar, 2965.032226,2123.313232,8.486142,1.500000);
        MoveObject(stairs, 2966.623046,2116.100097,6.840229,1.500000);
        return 1;
    }
    if(strcmp(cmdtext,"/csdoor", true) == 0 && CanUseDoor[playerid] == 1)
    {
        MoveObject(sdoor, 2974.106445,2116.620117,8.532794, 1.500000);
        MoveObject(radar, 2966.035156,2118.921875,8.486142, 1.500000);
        MoveObject(stairs, 2966.623046,2116.100097,2.008096,1.500000);
        return 1;
    }
    if(strcmp(cmdtext,"/setsdoor",true)==0)
    {
          if(!IsPlayerAdmin(playerid)) return 0;
          if(!strlen(cmdtext[10])) return SendClientMessage(playerid,0xFFFFFFFF,"Usage: /setsdoor [playerid]");
          new gplayerid = strval(cmdtext[10]);
          if(IsPlayerConnected(gplayerid))
          {
                 if(CanUseDoor[gplayerid] == 0)  CanUseDoor[gplayerid] = 1; // make gplayerid from playerid
                 else CanUseDoor[gplayerid] = 0;
                 return 1;
          }
          else return SendClientMessage(playerid,0xFFFFFFFF,"Player not connected");
     }
     return 0;
}

OnPlayerConnect(playerid)
{
      CanUseDoor[playerid] = 0;
}
I found a little error in my script but that still isn't going to fix your problem:

don't insert part of name, really insert a number like:
Код:
 /setsdoor 0
Anyway, modify what I just modified and update me.
Reply


Messages In This Thread
Making a /setsdoor - by Jack- - 20.12.2010, 15:14
Re: Making a /setsdoor - by scottyishere - 20.12.2010, 15:23
Re: Making a /setsdoor - by Jack- - 20.12.2010, 15:43
Re: Making a /setsdoor - by scottyishere - 20.12.2010, 15:57
Re: Making a /setsdoor - by Jack- - 20.12.2010, 15:58
Re: Making a /setsdoor - by scottyishere - 20.12.2010, 16:09
Re: Making a /setsdoor - by Jack- - 20.12.2010, 16:14
Re: Making a /setsdoor - by scottyishere - 20.12.2010, 16:27
Re: Making a /setsdoor - by Jack- - 20.12.2010, 16:28
Re: Making a /setsdoor - by scottyishere - 20.12.2010, 16:37

Forum Jump:


Users browsing this thread: 1 Guest(s)