pawn Код:
if (strcmp("/opendoor ", cmdtext, true, 10) == 0)
{
if(AL(playerid) >= 5 || FR(playerid, 3, 1, 2) == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /opendoor <NUMBER>"); return 1; }
new id = strval(tmp);
if(id == 1){
MoveDynamicObject(door1, 1163.458374, -1322.698486,1386.884888,0.8);
SendClientMessage(playerid, COLOR_WHITE,"Door 1 is open !");
}
if(id == 2){
MoveDynamicObject(door2, 1151.116577, -1319.286621, 1386.996338,0.8);
SendClientMessage(playerid, COLOR_WHITE,"Door 2 is open !");
}
if(id == 3){
MoveDynamicObject(door4,1148.669922, -1307.760986, 1386.799072, 0.8);
MoveDynamicObject(door3,1152.505493, -1307.765869, 1386.817383, 0.8);
SendClientMessage(playerid, COLOR_WHITE,"Door 3 is open !");
}
}
else SendClientMessage(playerid, COLOR_WHITE, "You are not a member of LSMD!");
return 1;
}
if (strcmp("/closedoor ", cmdtext, true, 11) == 0)
{
if(AL(playerid) >= 5 || FR(playerid, 3, 1, 2) == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /closedoor <NUMBER>"); return 1; }
new id = strval(tmp);
if(id == 1){
MoveDynamicObject(door1, 1163.458374, -1326.698486,1386.884888,0.8);
SendClientMessage(playerid, COLOR_WHITE,"Door 1 is closed !");
}
else if(id == 2){
MoveDynamicObject(door2, 1157.116577, -1319.286621, 1386.996338,0.8);
SendClientMessage(playerid, COLOR_WHITE,"Door 2 is closed !");
}
else if(id == 3){
MoveDynamicObject(door4, 1151.669922, -1307.760986, 1386.799072, 0.8);
MoveDynamicObject(door3, 1149.505493, -1307.765869, 1386.817383, 0.8);
SendClientMessage(playerid, COLOR_WHITE,"Door 3 is closed !");
}
else SendClientMessage(playerid, COLOR_WHITE, "Wrong number");
}
else SendClientMessage(playerid, COLOR_WHITE, "You are not a member of LSMD!");
return 1;
}
What you did wrong was the space.You didn't leave space on /opendoor and /closedoor