Help me fix this.
#1

I updates some plugins and the gate system doesn't work.. i do /creategate [ID] after that /gedit close - save the position- after that /gedit open -save- and the gate goes back to its old place where i did /creategate and doesn't work anymore.
PHP код:
CMD:gedit(playeridparams[])
{
    new 
string[128], idx;
    if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
     if(
sscanf(params"s[128]"params))
    {
        
SendClientMessage(playeridCOLOR_WHITE"USAGE: /gedit [option] [gateid]");
        
SendClientMessage(playeridCOLOR_GREY"OPTIONS: object | close | open | speed | password");
        return 
1;
    }
    if(!
strcmp(params"object"true5))
    {
        new 
object;
        if(
sscanf(params"s[128]ii"paramsidxobject)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /gedit object [gateid] [objectid]");
        if(!
GateInfo[idx][gModel]) return SendClientMessage(playeridCOLOR_GREY"Invalid gate id.");
        if(
object == 0)
        {
            
format(stringsizeof(string), "%d"object);
            
cmd_deletegate(playeridstring);
            return 
1;
        }
        
GateInfo[idx][gModel] = object;
        
DestroyDynamicObject(GateInfo[idx][gGate]);
        
GateInfo[idx][gGate] = CreateDynamicObject(GateInfo[idx][gModel], GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], GateInfo[idx][gCRX], GateInfo[idx][gCRY], GateInfo[idx][gCRZ]);
        
format(stringsizeof(string), " You have set gate ID %d's object ID to %d."idxobject);
        
SendClientMessage(playeridCOLOR_WHITEstring);
    }
    else if(!
strcmp(params"close"true5))
    {
        if(
sscanf(params"s[128]i"paramsidx)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /gedit position [gateid]");
        if(!
GateInfo[idx][gModel]) return SendClientMessage(playeridCOLOR_GREY"Invalid gate id.");
        
gEdit[playerid] = 1;
        
gEditID[playerid] = idx;
        
GetDynamicObjectPos(GateInfo[idx][gGate], gPos[playerid][0], gPos[playerid][1], gPos[playerid][2]);
        
GetDynamicObjectRot(GateInfo[idx][gGate], gRot[playerid][0], gRot[playerid][1], gRot[playerid][2]);
        
EditDynamicObject(playeridGateInfo[idx][gGate]);
        
format(stringsizeof(string), " You are now editing gate ID %d's closing position."idx);
        
SendClientMessage(playeridCOLOR_WHITEstring);
    }
    else if(!
strcmp(params"open"true4))
    {
        if(
sscanf(params"s[128]i"paramsidx)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /gedit open [gateid]");
        if(!
GateInfo[idx][gModel]) return SendClientMessage(playeridCOLOR_GREY"Invalid gate id.");
        
gEdit[playerid] = 2;
        
gEditID[playerid] = idx;
        
GetDynamicObjectPos(GateInfo[idx][gGate], gPos[playerid][0], gPos[playerid][1], gPos[playerid][2]);
        
GetDynamicObjectRot(GateInfo[idx][gGate], gRot[playerid][0], gRot[playerid][1], gRot[playerid][2]);
        
EditDynamicObject(playeridGateInfo[idx][gGate]);
        
format(stringsizeof(string), " You are now editing gate ID %d's opening position."idx);
        
SendClientMessage(playeridCOLOR_WHITEstring);
    }
    else if(!
strcmp(params"speed"true5))
    {
        new 
Float:speed;
        if(
sscanf(params"s[128]if"paramsidxspeed)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /gedit open [gateid] [speed]");
        if(!
GateInfo[idx][gModel]) return SendClientMessage(playeridCOLOR_GREY"Invalid gate id.");
        
GateInfo[idx][gSpeed] = speed;
        
format(stringsizeof(string), " You have set gate ID %d's moving speed to %f."idxspeed);
        
SendClientMessage(playeridCOLOR_WHITEstring);
    }
    else if(!
strcmp(params"password"true8))
    {
        new 
password[256];
        if(
sscanf(params"s[128]is[256]"paramsidxpassword)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /gedit open [gateid] [password]");
        if(!
GateInfo[idx][gModel]) return SendClientMessage(playeridCOLOR_GREY"Invalid gate id.");
        
format(GateInfo[idx][gPassword], 256"%s"password);
        
format(stringsizeof(string), " You have set gate ID %d's password to {FF6347}%s"idxpassword);
        
SendClientMessage(playeridCOLOR_WHITEstring);
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)