20.12.2010, 16:27
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;
}
don't insert part of name, really insert a number like:
Код:
/setsdoor 0