11.08.2013, 14:00
nothing happens when I type /opencell 1.
This time I'm using sscanf, why wouldn't this work, pretty confusing.
This time I'm using sscanf, why wouldn't this work, pretty confusing.
pawn Код:
CMD:opencell(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
new cell;
if(sscanf(params, "d", cell)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /opencell [cell 1 - 2]");
if(Faction[playerid] == 1 && IsPlayerInRangeOfPoint(playerid,10.0,312.42233, 325.14948, 1000.01660))
{
if(cell == 1)
{
MoveDynamicObject(celldoor1,312.42233, 325.14948, 1000.01660 -5,3.0,0,0,0);
SendClientMessage(playerid, COLOUR_GREY, "You have opened cell door 1.");
}
if(cell == 2)
{
MoveDynamicObject(celldoor2,312.41660, 321.08066, 1000.01660 -5,3.0,0,0,0);
SendClientMessage(playerid, COLOUR_GREY, "You have opened cell door 2.");
}
}
return 1;
}